/* VitSeguros · Boletos · peças comuns (usa só tokens.css) */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--brand-teal); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3, h4, p { margin: 0; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
.ic.lg { width: 24px; height: 24px; }

/* ---------- moldura ---------- */
.shell { max-width: 1360px; margin: 0 auto; padding: 16px 16px 120px; }
.topo {
  display: flex; align-items: center; gap: 12px;
  background: var(--cell); border-radius: var(--r-cell);
  padding: 10px 10px 10px 20px; margin-bottom: var(--gap);
  position: sticky; top: 12px; z-index: 30;
  box-shadow: 0 1px 0 rgba(6,25,45,.04);
}
.topo .logo { display: flex; align-items: center; gap: 10px; flex: none; }
.topo .logo img { height: 28px; width: auto; }
.topo .logo .simb { display: none; height: 34px; }
.topo .logo .mod {
  font-size: var(--t-sm); font-weight: 600; color: var(--ink-2);
  padding-left: 10px; margin-left: 2px; border-left: 2px solid var(--cell-3);
}
[data-tema="escuro"] .topo .logo .cor { display: none; }
.topo .logo .branco { display: none; }
[data-tema="escuro"] .topo .logo .branco { display: block; }
.nav { display: flex; gap: 4px; margin: 0 auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px; border-radius: var(--r-pill);
  color: var(--ink-2); font-weight: 600; font-size: var(--t-md);
}
.nav a:hover { background: var(--cell-2); text-decoration: none; color: var(--ink); }
.nav a[aria-current="page"] { background: var(--navy); color: var(--on-navy); }
.topo-acoes { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: var(--t-sm);
  background: var(--accent-soft); color: var(--accent-ink); border: 0; cursor: pointer;
}

/* faixa do modo ensaio e da pausa: sempre à vista */
.faixa {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-radius: var(--r-sub); padding: 10px 12px 10px 14px; margin-bottom: var(--gap);
  font-size: var(--t-sm); font-weight: 600;
}
.faixa.ensaio { background: var(--warn-soft); color: var(--warn); }
.faixa.pausa { background: var(--bad-soft); color: var(--bad); }
.faixa .txt { flex: 1 1 260px; }
.faixa .txt span { font-weight: 500; color: var(--ink-2); }

/* barra de abas do celular */
.tabbar { display: none; }

/* ---------- células ---------- */
.cell { background: var(--cell); border-radius: var(--r-cell); padding: var(--pad); min-width: 0; }
.cell.hero { background: var(--navy); color: var(--on-navy); }
.cell.hero .muted { color: var(--on-navy-2); }
.cell.flat { background: var(--cell-2); }
.sub { background: var(--cell-2); border-radius: var(--r-sub); padding: 16px; min-width: 0; }
.cell-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cell-head h2 { font-size: var(--t-lg); font-weight: 700; flex: 1; line-height: 1.25; }
.cell-head .acao { margin-left: auto; }
.titulo-pag { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 8px 4px 20px; }
.titulo-pag h1 { font-size: var(--t-2xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.titulo-pag p { color: var(--ink-2); font-size: var(--t-md); margin-top: 4px; }
.titulo-pag .dir { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.muted { color: var(--ink-2); }
.fraco { color: var(--ink-3); font-size: var(--t-sm); }
.grande { font-size: var(--t-3xl); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.medio { font-size: var(--t-xl); font-weight: 700; letter-spacing: -.01em; line-height: 1.15; }

/* ícone em quadradinho colorido */
.ico {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
}
.ico.sm { width: 32px; height: 32px; border-radius: 10px; }
.ico.ok { background: var(--ok-soft); color: var(--ok); }
.ico.bad { background: var(--bad-soft); color: var(--bad); }
.ico.warn { background: var(--warn-soft); color: var(--warn); }
.ico.info { background: var(--info-soft); color: var(--info); }
.ico.violet { background: var(--violet-soft); color: var(--violet); }
.ico.mute { background: var(--mute-soft); color: var(--mute); }
.ico.navy { background: var(--navy-2); color: var(--on-navy); }
.ico.round { border-radius: 50%; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-pill);
  border: 0; cursor: pointer; font-weight: 700; font-size: var(--t-md);
  background: var(--cell-2); color: var(--ink);
  transition: background .15s var(--ease), transform .1s var(--ease);
  text-decoration: none !important; white-space: nowrap;
}
.btn:hover { background: var(--cell-3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.navy { background: var(--navy); color: var(--on-navy); }
.btn.on-navy { background: rgba(255,255,255,.12); color: var(--on-navy); }
.btn.on-navy:hover { background: rgba(255,255,255,.2); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--cell-2); color: var(--ink); }
.btn.lg { min-height: 54px; padding: 0 26px; font-size: var(--t-lg); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: var(--t-sm); }
.btn.icon { width: 44px; padding: 0; }
.btn.sm.icon { width: 36px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- chips de status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: var(--t-xs); font-weight: 700; white-space: nowrap;
  background: var(--mute-soft); color: var(--ink-2); /* ink-2 sobre mute-soft: 6,4:1 no claro; o --mute puro dava 4,3:1 */
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.no-dot::before { display: none; }
.st-agendado, .st-programado { background: var(--info-soft); color: var(--info); }
.st-enviando { background: var(--info-soft); color: var(--info); }
.st-enviado { background: var(--accent-soft); color: var(--accent-ink); }
.st-entregue, .st-pago, .chip.ok { background: var(--ok-soft); color: var(--ok); }
.st-lido { background: var(--violet-soft); color: var(--violet); }
.st-falhou, .chip.bad { background: var(--bad-soft); color: var(--bad); }
.st-incerto, .chip.warn { background: var(--warn-soft); color: var(--warn); }
.st-cancelado { background: var(--mute-soft); color: var(--ink-2); }
.st-lido::after { content: "sinal fraco"; font-weight: 500; opacity: .8; margin-left: 2px; }

/* filtros (chips clicáveis) */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.filtro {
  min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 0; cursor: pointer;
  background: var(--cell); color: var(--ink-2); font-weight: 600; font-size: var(--t-sm);
  display: inline-flex; align-items: center; gap: 8px;
}
.cell .filtro { background: var(--cell-2); }
.filtro[aria-pressed="true"] { background: var(--navy); color: var(--on-navy); }
.filtro .n { font-variant-numeric: tabular-nums; opacity: .75; }

/* ---------- campos ---------- */
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo > label, .rotulo { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border-radius: var(--r-ctl); border: 1.5px solid var(--line);
  background: var(--cell); color: var(--ink); font-size: var(--t-md);
}
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.erro { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.input.aviso { border-color: var(--warn); }
.ajuda { font-size: var(--t-sm); color: var(--ink-3); }
.ajuda.erro { color: var(--bad); font-weight: 600; }
.ajuda.aviso { color: var(--warn); font-weight: 600; }
.busca { position: relative; }
.busca .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.busca .input { padding-left: 46px; min-height: 54px; font-size: var(--t-lg); border-radius: var(--r-sub); }

/* segmentado */
.seg { display: inline-flex; background: var(--cell-2); border-radius: var(--r-pill); padding: 4px; gap: 2px; }
.seg button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: transparent; color: var(--ink-2); font-weight: 600; font-size: var(--t-sm);
}
.seg button[aria-pressed="true"] { background: var(--cell); color: var(--ink); box-shadow: 0 1px 3px rgba(6,25,45,.12); }

/* interruptor */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .trilho {
  width: 52px; height: 30px; border-radius: 99px; background: var(--cell-3); position: relative; flex: none;
  transition: background .2s var(--ease);
}
.switch .trilho::after {
  content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease);
}
.switch input:checked + .trilho { background: var(--accent); }
.switch.warn input:checked + .trilho { background: var(--warn); }
.switch input:checked + .trilho::after { transform: translateX(22px); }
.switch input:focus-visible + .trilho { outline: 3px solid var(--brand-teal); outline-offset: 2px; }

/* ---------- listas ---------- */
.lista { display: flex; flex-direction: column; gap: 8px; }
.item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--r-sub); background: var(--cell-2);
  color: var(--ink); min-width: 0;
}
a.item:hover, button.item:hover { background: var(--cell-3); text-decoration: none; }
button.item { border: 0; width: 100%; text-align: left; cursor: pointer; }
.item .meio { flex: 1; min-width: 0; }
.item .t1 { font-weight: 700; font-size: var(--t-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .t2 { font-size: var(--t-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .fim { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.item .valor { font-weight: 700; font-variant-numeric: tabular-nums; }

/* alertas dentro da tela */
.alerta {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-sub); font-size: var(--t-sm);
}
.alerta .ic { margin-top: 1px; }
.alerta b { display: block; font-size: var(--t-md); }
.alerta.bad { background: var(--bad-soft); color: var(--bad); }
.alerta.warn { background: var(--warn-soft); color: var(--warn); }
.alerta.info { background: var(--info-soft); color: var(--info); }
.alerta.ok { background: var(--ok-soft); color: var(--ok); }
.alerta p { color: var(--ink-2); margin-top: 2px; }
.alerta .acoes { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* anel de progresso */
.anel { position: relative; width: 112px; height: 112px; flex: none; }
.anel svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anel circle { fill: none; stroke-width: 11; }
.anel .fundo { stroke: rgba(255,255,255,.14); }
.cell:not(.hero) .anel .fundo { stroke: var(--cell-3); }
.anel .frente { stroke: var(--brand-teal); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.anel .centro { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.anel .centro b { font-size: var(--t-xl); font-weight: 800; }
.anel .centro span { font-size: var(--t-xs); opacity: .8; }

/* barras pequenas: <div class="barra"><span class="q">11</span><div class="col"><i style="height:65%"></i></div><small>seg</small></div> */
.barras { display: flex; gap: 10px; height: 150px; }
.barra { flex: 1; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; gap: 6px; }
.barra .col { width: 100%; max-width: 44px; height: 100%; border-radius: 10px; background: var(--cell-2); position: relative; overflow: hidden; }
.barra .col i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--brand-teal); border-radius: 10px; }
.barra.hoje .col i { background: var(--navy); }
.barra.futuro .col i { background: var(--info-soft); outline: 2px dashed var(--info); outline-offset: -2px; }
[data-tema="escuro"] .barra.hoje .col i { background: var(--accent); }
.barra small { font-size: var(--t-xs); color: var(--ink-3); font-weight: 600; }
.barra .q { font-size: var(--t-sm); font-weight: 700; }

/* vazio, carregando, erro */
.vazio { text-align: center; padding: 32px 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vazio .ico { width: 56px; height: 56px; border-radius: 18px; }
.vazio h3 { font-size: var(--t-lg); }
.vazio p { color: var(--ink-2); max-width: 380px; }
.esqueleto { border-radius: 10px; background: linear-gradient(90deg, var(--cell-2), var(--cell-3), var(--cell-2)); background-size: 200% 100%; animation: brilho 1.3s linear infinite; }
@keyframes brilho { to { background-position: -200% 0; } }

/* estados do protótipo: cada bloco declara em qual estado aparece */
[hidden] { display: none !important; }

.proto {
  position: fixed; left: 16px; bottom: 16px; z-index: 50;
  display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px;
  background: #111c26; color: #dfe8ef; border-radius: 99px; font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow-float);
}
.proto button {
  border: 0; background: transparent; color: #a8b8c6; min-height: 32px; padding: 0 10px; border-radius: 99px; cursor: pointer; font-size: 12px; font-weight: 600;
}
.proto button[aria-pressed="true"] { background: #2bc3c8; color: #032326; }

/* menu de três pontinhos */
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; z-index: 40;
  background: var(--cell); border-radius: var(--r-sub); padding: 6px; box-shadow: var(--shadow-float);
  display: none;
}
.menu-pop.aberto { display: block; }
.menu-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px;
  border: 0; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; font-weight: 600; font-size: var(--t-sm);
}
.menu-pop button:hover { background: var(--cell-2); }
.menu-pop button.perigo { color: var(--bad); }
.tem-menu { position: relative; }

/* diálogo */
dialog {
  border: 0; padding: 0; border-radius: 28px; background: var(--cell); color: var(--ink);
  width: min(560px, calc(100vw - 24px)); box-shadow: var(--shadow-float);
}
dialog::backdrop { background: rgba(4, 16, 28, .55); }
.dlg { padding: 28px; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - 40px); overflow: auto; }
.dlg h2 { font-size: var(--t-xl); font-weight: 800; letter-spacing: -.01em; }
.dlg .rodape { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* aviso que aparece e some */
.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--navy); color: var(--on-navy); padding: 12px 18px; border-radius: 99px;
  font-weight: 600; font-size: var(--t-sm); z-index: 80; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease); display: flex; gap: 10px; align-items: center;
}
.toast.vis { opacity: 1; transform: translate(-50%, 0); }

/* entrada das células: roda sozinha ao abrir a tela, uma vez */
@media (prefers-reduced-motion: no-preference) {
  .entra > * { animation: sobe .45s var(--ease) both; }
  .entra > *:nth-child(2) { animation-delay: .05s; }
  .entra > *:nth-child(3) { animation-delay: .1s; }
  .entra > *:nth-child(4) { animation-delay: .15s; }
  .entra > *:nth-child(5) { animation-delay: .2s; }
  .entra > *:nth-child(n+6) { animation-delay: .25s; }
}
@keyframes sobe { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- celular e tablet ---------- */
@media (max-width: 1100px) {
  .nav a span { display: none; }
  .nav a { padding: 0 13px; }
}
@media (max-width: 760px) {
  :root { --pad: 18px; --t-2xl: 28px; --t-3xl: 40px; }
  .shell { padding: 10px 10px 110px; }
  .topo { padding: 8px 8px 8px 14px; top: 8px; }
  .topo .logo img.cor, .topo .logo img.branco, .topo .logo .mod { display: none !important; }
  .topo .logo .simb { display: block; }
  .nav, .topo .so-desk { display: none !important; }
  .topo-acoes { margin-left: auto; }
  .titulo-pag { margin: 4px 4px 14px; }
  .titulo-pag .dir { margin-left: 0; width: 100%; }
  .tabbar {
    display: flex; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 40;
    background: var(--navy); border-radius: var(--r-cell); padding: 6px;
    box-shadow: var(--shadow-float);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 54px; border-radius: 18px; color: var(--on-navy-2); font-size: 11px; font-weight: 600;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
  .tabbar a.novo .ic { width: 22px; height: 22px; }
  .tabbar a.novo span.bolha { width: 40px; height: 32px; border-radius: 12px; background: var(--brand-teal); color: #032326; display: grid; place-items: center; }
  .proto { left: 50%; transform: translateX(-50%); bottom: 86px; padding-left: 10px; }
  .proto .rot { display: none; }
  .toast { bottom: 170px; width: max-content; max-width: calc(100vw - 32px); border-radius: 18px; }
  .item { align-items: flex-start; }
  .item .t1, .item .t2 { white-space: normal; }
  .dlg { padding: 22px; }
}

/* alvos de toque de 44 px no celular (vistoria) */
@media (max-width: 760px) {
  .btn.sm, .filtro, .atalho, .seg button, .topo .logo { min-height: 44px; }
  .btn.sm.icon { width: 44px; }
  .topo .logo { min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
}
