/*
 * Topnet — folha de estilo do aplicativo.
 *
 * Desenho escolhido pelo Kayo em 13/10/2026 (B, "branco com azul"), a partir
 * da referencia que o cliente mandou: moldura clara, trilha de icones a
 * esquerda, cards brancos com sombra azulada, e as cores do anel do "O" da
 * logo como detalhe — nunca como fundo.
 *
 * Tres coisas nao sao decoracao e explicam quase todo o arquivo:
 *
 *   - o azul da logo e a cor de selecao e de acao; o azul-marinho carrega
 *     titulo e texto forte. As cores do anel (magenta, laranja, teal, verde)
 *     marcam categoria: o icone de um card, o fio da borda, o anel do
 *     mostrador. Estado (pago, atrasado) tem cores proprias e reservadas;
 *   - nao ha tabela em lugar nenhum. Cada item e uma linha-cartao com chip de
 *     icone; o que esta vencido vem com a linha inteira preenchida;
 *   - a moldura tem altura fixa e quem rola e a lista de dentro. E um programa
 *     de mesa, nao uma pagina.
 *
 * Os componentes de formulario (lista, calendario, sugestoes, confirmacao,
 * arquivo, olho da senha) vieram do Tribus, onde foram aprovados um a um: nada
 * aqui tem cara de Windows ou de navegador.
 */

:root {
  /* marca */
  --tn-accent: #1e59b0;
  --tn-accent-deep: #133f79;
  --tn-navy: #133f79;
  --tn-sky: #5d92ce;
  --tn-magenta: #b72e58;
  --tn-red: #e03848;
  --tn-orange: #ffa32d;
  --tn-yellow: #ffd03c;
  --tn-teal: #469aab;
  --tn-green: #4dac95;

  --tn-ink: #0f2a52;
  --tn-soft: #4e6383;
  --tn-muted: #647996;

  --tn-page: #dce5f2;
  --tn-frame-bg: #f4f7fc;
  --tn-card: #ffffff;
  --tn-sunken: #eef3fa;
  --tn-line: #e3eaf4;

  /* Cor de dado. */
  --tn-in: #1e59b0;
  --tn-out: #e07a1f;

  /* Estado. Reservadas: nunca viram "mais uma cor". Cheias, com letra branca
     (aviso cheio, sem neon). */
  --tn-good: #1d8656;
  --tn-warn: #b4650c;
  --tn-bad: #c0392b;

  /* O canto da moldura. A casca do programa de mesa muda so isto. */
  --tn-frame: 22px;

  --tn-shadow: 0 1px 2px rgb(19 63 121 / 5%), 0 10px 28px rgb(19 63 121 / 8%);
  --tn-shadow-lift: 0 2px 6px rgb(19 63 121 / 6%), 0 18px 44px rgb(19 63 121 / 12%);
  --tn-shadow-accent: 0 10px 24px rgb(30 89 176 / 30%);

  /* O anel do "O", de cima para baixo. */
  --tn-ring: linear-gradient(180deg, #b72e58, #ff5a2e 35%, #ffa32d 50%, #4dac95 68%, #469aab 82%, #1e59b0);
}

* { box-sizing: border-box; }

/*
 * Barra de rolagem fina, arredondada e da cor da marca. As duas sintaxes
 * existem porque nenhuma cobre tudo sozinha; o aplicativo de mesa roda sobre o
 * Chromium do Electron, que usa a do WebKit.
 */
* {
  scrollbar-width: thin;
  scrollbar-color: #c3d3ea transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #c9d7ec;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--tn-accent); background-clip: content-box; }
*::-webkit-scrollbar-corner { background: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--tn-page);
  color: var(--tn-ink);
  font: 14px/1.45 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; color: var(--tn-ink); font-weight: 700; letter-spacing: -0.01em; }
a { color: var(--tn-accent); }
.tn-icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ================================================================= moldura */

.tn-app {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  max-width: 1440px;
  height: calc(100vh - 32px);
  margin: 16px auto;
  background: var(--tn-frame-bg);
  border-radius: var(--tn-frame);
  box-shadow: var(--tn-shadow-lift);
  overflow: hidden;
}

/* O fio colorido na borda esquerda: o anel do "O" desenrolado. */
.tn-app::before {
  content: '';
  position: absolute;
  left: 0;
  top: var(--tn-frame);
  bottom: var(--tn-frame);
  width: 3px;
  border-radius: 3px;
  background: var(--tn-ring);
  z-index: 3;
}

/* ------------------------------------------------------------------- trilha */

.tn-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 0 14px;
  border-right: 1px solid var(--tn-line);
  min-height: 0;
}

.tn-rail-brand { display: block; margin-bottom: 18px; }
.tn-rail-brand img { display: block; width: 40px; height: 40px; }

.tn-rail-item {
  position: relative;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: none;
  color: #8ca0bf;
  border-radius: 12px;
  text-decoration: none;
  transition: background-color 140ms ease, color 140ms ease;
}
.tn-rail-item:hover { color: var(--tn-navy); background: var(--tn-sunken); }
.tn-rail-item .tn-icon { width: 22px; height: 22px; }

.tn-rail-item.tn-current { color: var(--tn-navy); background: #e6edf8; }
/*
 * A barriguinha: o fio colorido da borda se curva para dentro na altura da
 * secao atual (pedido do Kayo, 13/10/2026). E o mesmo degrade do fio, preso a
 * janela (background-attachment: fixed), entao a curva tem a cor que o fio tem
 * naquela altura — parece o proprio fio inchando, e nao uma peca colada.
 */
.tn-rail-item.tn-current::after {
  content: '';
  position: absolute;
  left: -16px;
  top: 0;
  bottom: 0;
  width: 10px;
  border-radius: 0 100% 100% 0 / 0 50% 50% 0;
  background: var(--tn-ring);
  background-attachment: fixed;
  background-size: 100% calc(100vh - 32px - 2 * var(--tn-frame));
  background-position: 0 calc(16px + var(--tn-frame));
}

.tn-rail-grow { flex: 1; }

.tn-exit { margin: 0; }
.tn-exit button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: none;
  color: #8ca0bf;
  cursor: pointer;
}
.tn-exit button:hover { color: var(--tn-bad); background: var(--tn-sunken); }

.tn-rail-version { font-size: 10px; color: var(--tn-muted); margin-top: 4px; }

/* ================================================================= conteudo */

.tn-main {
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 18px 26px 20px 28px;
  display: flex;
  flex-direction: column;
}

.tn-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  flex: none;
}

.tn-title h1 { font-size: 21px; line-height: 1.2; }
.tn-title p { margin: 2px 0 0; font-size: 12px; color: var(--tn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tn-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 340px;
  max-width: 100%;
  height: 40px;
  padding: 0 16px;
  background: var(--tn-card);
  border-radius: 999px;
  box-shadow: var(--tn-shadow);
  color: var(--tn-muted);
}
.tn-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--tn-ink);
  outline: none;
}
.tn-search:focus-within { box-shadow: var(--tn-shadow), 0 0 0 2px var(--tn-accent); }

.tn-who { display: flex; align-items: center; justify-content: flex-end; gap: 12px; font-size: 13px; min-width: 0; }
.tn-who-date { font-weight: 650; white-space: nowrap; }
.tn-avatar {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tn-navy), var(--tn-sky));
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  border: 2px solid var(--tn-card);
  box-shadow: var(--tn-shadow);
}
.tn-who-name { line-height: 1.2; min-width: 0; }
.tn-who-name b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-who-name span { display: block; font-size: 11px; color: var(--tn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tn-cap {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tn-muted);
}

/* Titulo de bloco dentro da pagina, como "Vencendo hoje". */
.tn-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex: none; margin: 0 2px 10px; }
.tn-section-head h2 { font-size: 15px; }
.tn-section-head span, .tn-section-head a { font-size: 12px; color: var(--tn-muted); text-decoration: none; }
.tn-section-head a:hover { color: var(--tn-accent); }

.tn-cols {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 22px;
  margin-top: 18px;
}
.tn-cols.tn-alone { grid-template-columns: minmax(0, 1fr); }

.tn-left { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.tn-aside { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 2px 4px 4px 2px; }

.tn-left > .tn-cap { margin: 16px 2px 9px; flex: none; }
.tn-left > .tn-cap:first-child { margin-top: 2px; }
.tn-left > .tn-feed + .tn-cap { margin-top: 14px; }
.tn-aside > .tn-cap { margin: 8px 2px 2px; }
.tn-aside > .tn-cap:first-child { margin-top: 0; }

/* ================================================================== numeros */

.tn-strip { display: flex; gap: 14px; flex: none; }

.tn-tile {
  flex: 1;
  min-width: 0;
  padding: 13px 16px 14px;
  background: var(--tn-card);
  border-radius: 18px;
  box-shadow: var(--tn-shadow);
}
.tn-tile p { margin: 0 0 4px; font-size: 11.5px; font-weight: 600; color: var(--tn-soft); }
.tn-tile strong { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tn-tile strong small { font-size: 12px; color: var(--tn-muted); font-weight: 600; margin-right: 3px; }
.tn-tile span { font-size: 11px; color: var(--tn-muted); }
.tn-tile-win strong { color: var(--tn-good); }
.tn-tile-lose strong { color: var(--tn-bad); }


/* ================================================================== filtros */

.tn-filters { display: flex; gap: 8px; margin: 14px 0 10px; flex: none; flex-wrap: wrap; }
.tn-pill {
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--tn-card);
  box-shadow: var(--tn-shadow);
  font-size: 12px;
  font-weight: 600;
  color: var(--tn-soft);
  text-decoration: none;
  white-space: nowrap;
}
.tn-pill:hover { color: var(--tn-ink); }
.tn-pill.tn-on { background: var(--tn-accent); color: #fff; box-shadow: var(--tn-shadow-accent); }

/* =================================================================== linhas */

/* Quem rola e a lista, nao a pagina: a barra de cima e a coluna da direita
   ficam onde estao. */
.tn-feed {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px 4px 2px;
}

.tn-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  background: var(--tn-card);
  border-radius: 17px;
  box-shadow: var(--tn-shadow);
  flex: none;
}

.tn-row-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--tn-sunken);
  color: var(--tn-accent-deep);
}
.tn-row-text { flex: 1; min-width: 0; }
.tn-row-text b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tn-row-text span {
  display: block;
  font-size: 11.5px;
  color: var(--tn-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tn-row-date { font-size: 12px; color: var(--tn-soft); font-variant-numeric: tabular-nums; flex: none; }
.tn-row-amount {
  width: 112px;
  text-align: right;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: none;
}
.tn-amount-in { color: var(--tn-good); }
.tn-row-actions { display: flex; gap: 6px; flex: none; }

/* Vencido: a linha inteira preenchida. E o mesmo gesto do aparelho ligado no
   desenho, e faz o atraso saltar sem precisar de outra tela. */
.tn-row-hot { background: var(--tn-magenta); box-shadow: 0 10px 24px rgb(183 46 88 / 28%); }
.tn-row-hot .tn-row-icon { background: rgb(255 255 255 / 22%); color: #fff; }
.tn-row-hot .tn-row-text b,
.tn-row-hot .tn-row-date,
.tn-row-hot .tn-row-amount { color: #fff; }
.tn-row-hot .tn-row-text span { color: rgb(255 255 255 / 80%); }

/* Linha resolvida: sem peso, mas ainda legivel. */
.tn-row-done { box-shadow: none; background: var(--tn-sunken); }
.tn-row-done .tn-row-text b { color: var(--tn-soft); font-weight: 550; }
.tn-row-done .tn-row-amount { color: var(--tn-soft); }

.tn-ghost {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--tn-sunken);
  color: var(--tn-soft);
  cursor: pointer;
  padding: 0;
}
.tn-ghost:hover { background: #e6ebf1; color: var(--tn-ink); }
.tn-row-hot .tn-ghost { background: rgb(255 255 255 / 22%); color: #fff; }
.tn-row-hot .tn-ghost:hover { background: rgb(255 255 255 / 34%); }
.tn-ghost-danger:hover { color: var(--tn-bad); }

.tn-empty {
  margin: 0;
  padding: 26px 18px;
  text-align: center;
  color: var(--tn-muted);
  font-size: 13px;
  background: var(--tn-card);
  border-radius: 17px;
  box-shadow: var(--tn-shadow);
}

/* ============================================================ coluna direita */

/*
 * Faixa de acao: icone em cima, rotulo embaixo.
 *
 * O icone desce 17px dentro da faixa, aqui e nao so no painel — a coluna da
 * direita usa a mesma peca, e sem isto os dois lugares ficavam com o icone
 * grudado no topo. O `top` nao muda o tamanho da caixa, so desenha mais abaixo;
 * o vao de 20px devolve ao rotulo o respiro que o deslocamento come.
 *
 * O line-height fixo e de proposito: o rotulo e um no de texto solto dentro do
 * grid, e a folga da linha dele era parte do desalinho.
 */
.tn-act {
  display: grid;
  place-items: center;
  gap: 20px;
  height: 86px;
  line-height: 1.2;
  background: var(--tn-card);
  border-radius: 18px;
  box-shadow: var(--tn-shadow);
  color: var(--tn-soft);
  text-decoration: none;
  font-size: 11.5px;
  flex: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  text-align: center;
}
.tn-act .tn-icon { position: relative; top: 17px; }
.tn-act:hover { color: var(--tn-ink); }
.tn-act-on { background: var(--tn-accent); color: #fff; box-shadow: var(--tn-shadow-accent); }
.tn-act-on:hover { color: #fff; background: var(--tn-accent-deep); }

/* Na coluna da direita o icone tambem e o alvo do clique, e nao um enfeite ao
   lado do texto: 30px no lugar dos 20 que vem do `act`. O traco afina junto —
   a mesma espessura num desenho maior pesa demais e borra o miolo.

   O vao entre icone e rotulo nao muda com isso: o conteudo recentra na faixa,
   entao o pe do icone e o topo do texto descem os mesmos 5px. */
.tn-aside .tn-act .tn-icon { width: 30px; height: 30px; stroke-width: 1.5; }

.tn-mini {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  background: var(--tn-card);
  border-radius: 16px;
  box-shadow: var(--tn-shadow);
  flex: none;
}
.tn-mini-icon {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--tn-sunken);
  border-radius: 11px;
  color: var(--tn-accent-deep);
}
.tn-mini-text { flex: 1; min-width: 0; }
.tn-mini-text b { display: block; font-size: 12.5px; font-weight: 600; }
.tn-mini-text span { display: block; font-size: 11px; color: var(--tn-muted); }
.tn-mini-value { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tn-mini-hot { background: var(--tn-magenta); box-shadow: 0 10px 24px rgb(183 46 88 / 28%); }
.tn-mini-hot .tn-mini-icon { background: rgb(255 255 255 / 22%); color: #fff; }
.tn-mini-hot .tn-mini-text b, .tn-mini-hot .tn-mini-value { color: #fff; }
.tn-mini-hot .tn-mini-text span { color: rgb(255 255 255 / 80%); }

/* =================================================================== botoes */

.tn-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--tn-card);
  box-shadow: var(--tn-shadow);
  color: var(--tn-soft);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.tn-button:hover { color: var(--tn-ink); }
.tn-button-primary { background: var(--tn-accent); color: #fff; box-shadow: var(--tn-shadow-accent); }
.tn-button-primary:hover { background: var(--tn-accent-deep); color: #fff; }
.tn-button-flat { box-shadow: none; background: var(--tn-sunken); }
.tn-button:disabled { opacity: 0.5; cursor: not-allowed; }

.tn-head { display: flex; align-items: center; gap: 12px; flex: none; }
.tn-head > :last-child:not(h1):not(p) { margin-left: auto; }

/* ================================================================ formulario */

.tn-form { display: flex; flex-direction: column; gap: 14px; }
.tn-field { display: flex; flex-direction: column; gap: 5px; }
.tn-field > label { font-size: 12.5px; font-weight: 600; color: var(--tn-soft); }
.tn-field input,
.tn-field select,
.tn-field textarea {
  padding: 11px 13px;
  border: 1px solid var(--tn-line);
  border-radius: 13px;
  background: var(--tn-card);
  font: inherit;
  color: var(--tn-ink);
  outline: none;
}
.tn-field input:focus,
.tn-field select:focus,
.tn-field textarea:focus { border-color: var(--tn-accent); box-shadow: 0 0 0 3px rgb(30 89 176 / 18%); }
.tn-field-hint { font-size: 11.5px; color: var(--tn-muted); }
.tn-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tn-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 2px; }

/* ================================================================== recados */

.tn-notice-slot { flex: none; margin-top: 12px; }
.tn-notice {
  margin: 0;
  padding: 11px 16px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 550;
}
.tn-notice-ok { background: var(--tn-good); color: #fff; }
.tn-notice-warn { background: var(--tn-warn); color: #fff; }
.tn-notice-error { background: var(--tn-bad); color: #fff; }
.tn-notice a { color: #fff; font-weight: 700; }

/* =================================================================== modal */

/* Insercao e alteracao em modal, nunca em aba nova: a pessoa nao perde de vista
   a lista de onde saiu. */
.tn-modal { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tn-modal[hidden] { display: none; }
.tn-modal-backdrop { position: absolute; inset: 0; background: rgb(22 32 50 / 42%); }
.tn-modal-box {
  position: relative;
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px 22px 22px;
  background: var(--tn-card);
  border-radius: 26px;
  box-shadow: 0 24px 60px rgb(22 32 50 / 26%);
}
.tn-modal-head { display: flex; align-items: center; margin-bottom: 14px; }
.tn-modal-head h2 { font-size: 17px; }
.tn-modal-close {
  margin-left: auto;
  border: 0;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--tn-muted);
  cursor: pointer;
  padding: 0 4px;
}


/* ================================================== balão e lista própria

   O balão do sistema e a lista aberta de um <select> são desenhados pelo
   sistema operacional, não pela página: fonte dele, canto quadrado, atraso
   dele. No meio de uma moldura arredondada eles aparecem como peça de outro
   programa — e no aplicativo de mesa isso fica gritante.

   Os dois abaixo são nossos. O <select> continua existindo no HTML e é ele
   que o formulário envia: a lista bonita só o dirige. Sem JavaScript, o
   select nativo aparece e funciona como sempre. */

/*
 * Azul da marca, e nao o cinza-escuro do sistema.
 *
 * O balao do Windows 11 tambem e uma caixa escura arredondada: o primeiro
 * desenho ficou tao parecido com ele que a troca nao se notava. Este e
 * inconfundivelmente nosso — a cor dos titulos, e a mesma sombra dos cartoes.
 */
.tn-tip {
  position: fixed;
  z-index: 300;
  padding: 7px 12px;
  background: var(--tn-navy);
  color: #fff;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.3;
  border-radius: 10px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 20px rgb(19 63 121 / 34%);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 110ms ease, transform 110ms ease;
}
.tn-tip[data-open] { opacity: 1; transform: none; }
.tn-tip[hidden] { display: none; }

/* ---------------------------------------------------------- lista propria */

.tn-select { position: relative; }
/* O nativo fica no HTML — e ele que o formulario envia —, so sai da vista. */
.tn-select > select { position: absolute; opacity: 0; pointer-events: none; width: 100%; height: 100%; }

.tn-select-button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--tn-line);
  border-radius: 13px;
  background: var(--tn-card);
  font: inherit;
  color: var(--tn-ink);
  text-align: left;
  cursor: pointer;
}
.tn-select-button:focus-visible,
.tn-select[data-open] .tn-select-button {
  outline: none;
  border-color: var(--tn-accent);
  box-shadow: 0 0 0 3px rgb(30 89 176 / 18%);
}
.tn-select-button span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-select-button svg { flex: none; color: var(--tn-muted); transition: transform 140ms ease; }
.tn-select[data-open] .tn-select-button svg { transform: rotate(180deg); }

.tn-select-list {
  position: absolute;
  z-index: 60;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 260px;
  overflow-y: auto;
  padding: 6px;
  background: var(--tn-card);
  border-radius: 16px;
  box-shadow: 0 2px 6px rgb(22 32 50 / 8%), 0 18px 40px rgb(22 32 50 / 18%);
  list-style: none;
  margin: 0;
}
.tn-select-list[hidden] { display: none; }

/* Abre para cima quando nao ha espaco embaixo — dentro de um modal isso e o
   caso comum, e uma lista cortada pela borda e pior que uma lista invertida. */
.tn-select[data-up] .tn-select-list { top: auto; bottom: calc(100% + 6px); }

.tn-select-list li {
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tn-select-list li[data-active] { background: var(--tn-sunken); }
.tn-select-list li[aria-selected='true'] {
  background: var(--tn-accent);
  color: #fff;
  font-weight: 600;
}

/* ------------------------------------------------- rotulo dentro do campo

   Usado na entrada e na troca de senha, onde o cartao precisa ser pequeno.

   Trocar rotulo por placeholder compactaria igual e custaria caro: o
   placeholder some no primeiro caractere, e quem volta ao formulario depois
   nao sabe mais qual campo e qual. Aqui o rotulo continua na tela sempre — ele
   sobe e encolhe, e nao desaparece.

   O input vem antes do label no HTML porque o seletor precisa do irmao
   seguinte para saber se o campo esta vazio. */

.tn-form-tight { gap: 11px; }

.tn-field-float { position: relative; gap: 0; }

.tn-field-float input {
  height: 56px;
  padding: 22px 15px 7px;
  font-size: 14.5px;
  border-radius: 14px;
}

.tn-field-float label {
  position: absolute;
  left: 16px;
  top: 18px;
  font-size: 14px;
  font-weight: 450;
  color: var(--tn-muted);
  pointer-events: none;
  transform-origin: left top;
  transition: transform 130ms ease, color 130ms ease, font-weight 130ms ease;
}

/* Cheio ou em foco, o rotulo sobe. `:placeholder-shown` so vale quando existe
   placeholder — dai o espaco em branco no HTML, que nao aparece na tela. */
.tn-field-float input:focus + label,
.tn-field-float input:not(:placeholder-shown) + label {
  transform: translateY(-12px) scale(0.76);
  color: var(--tn-accent-deep);
  font-weight: 650;
  letter-spacing: 0.04em;
}

/* O preenchimento automatico do navegador pinta o campo de azul e ignora o
   background do CSS. A sombra interna e o unico jeito de cobrir isso sem
   desligar o recurso. */
.tn-field-float input:-webkit-autofill,
.tn-field-float input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 40px var(--tn-card) inset;
  -webkit-text-fill-color: var(--tn-ink);
}


/* --- linha que leva a algum lugar

   O link fica no titulo, para leitor de tela e teclado, e o ::after estica a
   area de clique pela linha inteira. Os botoes da direita sobem por cima dele:
   clicar em "arquivar" nao pode abrir a ficha. */
.tn-row { position: relative; }
.tn-row-link { color: inherit; text-decoration: none; }
.tn-row-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.tn-row-link:focus-visible { outline: none; }
.tn-row:has(.tn-row-link:focus-visible) { outline: 2px solid var(--tn-accent); outline-offset: 2px; }
.tn-row:has(.tn-row-link):hover { box-shadow: var(--tn-shadow-lift); }
.tn-row-actions { position: relative; z-index: 1; }

/* --- confirmar uma acao que nao se desfaz

   No desenho do sistema, e nao a caixa do Windows: no programa de mesa ela
   aparecia com titulo, botao e fonte de outro programa. O app.js monta esta
   caixa uma vez e a reaproveita para toda pergunta de data-confirm. */
.tn-confirm { width: min(400px, 100%); padding: 26px 26px 22px; text-align: center; }
.tn-confirm-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(192 57 43 / 10%);
  color: var(--tn-bad);
}
.tn-confirm p { margin: 0 0 20px; font-size: 14.5px; line-height: 1.5; color: var(--tn-ink); }
.tn-confirm .tn-form-actions { justify-content: center; }

/* --- escolher um arquivo

   O input nativo continua la, invisivel e por cima de tudo: e ele que abre a
   janela de escolher, recebe o arquivo arrastado e vai no formulario. Por
   cima dele so muda o que se ve. */
.tn-file { position: relative; display: flex; align-items: center; gap: 12px; cursor: pointer; }
.tn-file input[type='file'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.tn-file:focus-within { outline: 2px solid var(--tn-accent); outline-offset: 2px; }
.tn-file-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--tn-card);
  box-shadow: var(--tn-shadow);
  color: var(--tn-accent-deep);
}
.tn-file-text { display: flex; flex-direction: column; min-width: 0; }
.tn-file-text b {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--tn-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tn-file-text span { font-size: 12px; color: var(--tn-muted); }

.tn-file-drop {
  flex-direction: column;
  justify-content: center;
  padding: 24px 16px 20px;
  border: 1.5px dashed #d3d9e2;
  border-radius: 16px;
  background: var(--tn-sunken);
  text-align: center;
  transition: border-color 120ms ease, background-color 120ms ease;
}
.tn-file-drop .tn-file-text { align-items: center; max-width: 100%; }
.tn-file-drop:hover,
.tn-file-drop.tn-file-over { border-color: var(--tn-accent); background: rgb(30 89 176 / 8%); }
.tn-file-drop.tn-file-chosen { border-style: solid; border-color: var(--tn-accent); background: var(--tn-card); }


/* ======================================== o que o navegador desenhava sozinho

   Calendario, lista de sugestoes, balao de "preencha este campo", o x da busca e
   o olho da senha do Edge: tudo isso vinha do navegador — e, no programa de
   mesa, com cara de outro programa. Aqui e no app.js eles passam a ser do
   Topnet. Sem JavaScript, cada campo continua funcionando do jeito nativo. */

/* --- o x da busca e o olho da senha: os nativos saem, o nosso entra */
input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
input::-ms-reveal,
input::-ms-clear { display: none; }

/* Centrado no campo de 56 px do rotulo flutuante, e nao no bloco inteiro: com
   o recado de erro embaixo, o centro do bloco desce. */
.tn-reveal {
  position: absolute;
  right: 10px;
  top: 28px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--tn-muted);
  cursor: pointer;
}
.tn-reveal:hover { background: var(--tn-sunken); color: var(--tn-ink); }
.tn-reveal[aria-pressed='true'] { color: var(--tn-accent-deep); }
.tn-has-reveal input { padding-right: 50px; }

/* --- recado de campo que falta ou esta errado

   No lugar do balao do navegador, que some sozinho e aparece com fonte de
   outro programa: uma linha embaixo do campo, que fica ate a pessoa corrigir. */
.tn-field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--tn-bad);
}
.tn-field-error .tn-icon { width: 14px; height: 14px; flex: none; }
.tn-invalid input,
.tn-invalid .tn-select-button,
.tn-invalid.tn-file-drop { border-color: var(--tn-bad) !important; }
.tn-invalid input:focus { box-shadow: 0 0 0 3px rgb(192 57 43 / 16%); }

/* --- sugestoes: a mesma lista do campo de selecao */
.tn-suggest { position: relative; }
/* O embrulho e que estica no campo; sem isto o input encolhia para a largura de
   texto dele. */
.tn-suggest input { width: 100%; }
.tn-suggest .tn-select-list li mark { background: none; color: inherit; font-weight: 700; }

/* --- calendario */
.tn-date { position: relative; }
.tn-date input[type='date'] { width: 100%; padding-right: 46px; }
.tn-date input[type='date']::-webkit-calendar-picker-indicator { display: none; }
.tn-date-button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--tn-accent-deep);
  cursor: pointer;
}
.tn-date-button:hover,
.tn-date[data-open] .tn-date-button { background: var(--tn-sunken); }

/* Fixa, e posta pelo app.js embaixo do campo: dentro de um modal com rolagem,
   uma caixa absoluta ficaria cortada pela borda dele. */
.tn-date-pop {
  position: fixed;
  z-index: 60;
  width: 296px;
  padding: 12px;
  background: var(--tn-card);
  border-radius: 18px;
  box-shadow: 0 2px 6px rgb(22 32 50 / 8%), 0 18px 40px rgb(22 32 50 / 18%);
}
.tn-date-pop[hidden] { display: none; }

.tn-date-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.tn-date-head b { flex: 1; text-align: center; font-size: 14px; font-weight: 650; color: var(--tn-navy); }
.tn-date-head b::first-letter { text-transform: uppercase; }
.tn-date-nav {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--tn-sunken);
  color: var(--tn-ink);
  cursor: pointer;
}
.tn-date-nav:hover { background: #e6ebf1; }

.tn-date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.tn-date-grid span {
  padding: 4px 0 6px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--tn-muted);
}
.tn-date-grid button {
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--tn-ink);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.tn-date-grid button:hover { background: var(--tn-sunken); }
.tn-date-grid button[data-other] { color: #c3c9d3; }
.tn-date-grid button[data-today] { box-shadow: inset 0 0 0 1.5px var(--tn-accent); font-weight: 650; }
.tn-date-grid button[aria-pressed='true'] { background: var(--tn-accent); color: #fff; font-weight: 650; box-shadow: none; }
.tn-date-grid button:focus-visible { outline: 2px solid var(--tn-navy); outline-offset: 1px; }

/* atalhos de vencimento, embaixo do calendario */
.tn-date-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--tn-line); }
.tn-date-quick button {
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--tn-sunken);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--tn-soft);
  cursor: pointer;
}
.tn-date-quick button:hover { background: var(--tn-accent); color: #fff; }

/* ============================================================== escritorio

   O que entrou em 05/10/2026: obrigacoes do mes (escolha 1B), cadastro em
   blocos (2A), cobranca em colunas (3B), area do cliente em cartoes (4A) e
   quanto cada cliente rende (6B). Pecas novas no desenho das que ja havia:
   linha-cartao, pilula, quadro de numero, coluna do funil. */

/* Escondido por codigo vence o display da classe: um bloco de botoes com
   display:flex e o atributo hidden continuaria na tela. */
[data-ob-only][hidden],
[data-when][hidden] { display: none !important; }

.tn-field-label { font-size: 12.5px; font-weight: 600; color: var(--tn-soft); }

/* --- quadro de numero que conta, e nao soma dinheiro */
.tn-tile-count strong small { margin: 0 0 0 5px; }

/* --- titulo com os passos de mes do lado */
.tn-titlebar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex: none; }
.tn-month { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex: none; }
.tn-month a {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--tn-card);
  box-shadow: var(--tn-shadow);
  color: var(--tn-soft);
}
.tn-month a:hover { color: var(--tn-ink); }
.tn-month b { font-size: 13px; color: var(--tn-navy); min-width: 124px; text-align: center; font-weight: 650; }

/* --- aviso com botao: "honorarios de outubro ainda nao lancados" */
.tn-notice-action { display: flex; align-items: center; gap: 12px; }
.tn-notice-action > span { flex: 1; min-width: 0; }
.tn-notice-action .tn-button { padding: 7px 14px; flex: none; }
.tn-notice-stack { display: flex; flex-direction: column; gap: 8px; }
.tn-notice-slot .tn-notice-stack + .tn-notice,
.tn-notice-slot .tn-notice + .tn-notice-stack { margin-top: 8px; }

/* --- lista no corpo do modal, sem cara de tabela */
.tn-plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.tn-plain-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 12px; background: var(--tn-sunken); font-size: 12.5px; }
.tn-plain-list li span { color: var(--tn-soft); white-space: nowrap; }

/* --- coluna da direita */
.tn-mini-link { display: block; color: inherit; text-decoration: none; flex: none; }
.tn-mini-link:hover .tn-mini { box-shadow: var(--tn-shadow-lift); }
.tn-aside-note { margin: 0 2px; font-size: 11.5px; line-height: 1.5; color: var(--tn-muted); }

/* --- grupo dentro da lista (catalogo, quanto rende) */
.tn-feed > .tn-cap { margin: 10px 6px 0; flex: none; }
.tn-feed > .tn-cap:first-child { margin-top: 2px; }
.tn-feed-spaced { margin-top: 14px; }

/* --- campo com botao do lado (CNPJ + Buscar) */
.tn-inline { display: flex; gap: 8px; }
.tn-inline input { flex: 1; min-width: 0; }
.tn-inline .tn-button { flex: none; }

/* --- botao que e so texto: "nao se aplica este mes" */
.tn-link-button {
  border: 0;
  background: none;
  padding: 4px 0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tn-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.tn-link-button:hover { color: var(--tn-ink); }


/* --- o que o cliente tem: uma pilula por obrigacao, ligada ou nao */
.tn-toggles {
  flex: none;
  margin: 2px 0 6px;
  padding: 12px 14px;
  background: var(--tn-card);
  border-radius: 17px;
  box-shadow: var(--tn-shadow);
}
.tn-toggles-head { margin: 0 0 9px; font-size: 12.5px; }
.tn-toggles-head b { display: block; font-weight: 650; }
.tn-toggles-head span { font-size: 11.5px; color: var(--tn-muted); }
.tn-toggle-form { display: contents; }
.tn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--tn-sunken);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--tn-soft);
  cursor: pointer;
}
.tn-toggle .tn-icon { width: 13px; height: 13px; stroke-width: 2.2; }
.tn-toggle i { font-style: normal; margin-left: 2px; opacity: 0.8; }
.tn-toggle:hover { color: var(--tn-ink); }
.tn-toggle-on { background: var(--tn-accent); color: #fff; }
.tn-toggle-on:hover { background: var(--tn-accent-deep); color: #fff; }

/* ------------------------------------------------ ficha: cadastro em blocos */
.tn-blocks {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  padding: 2px 4px 4px 2px;
}
.tn-block { background: var(--tn-card); border-radius: 20px; box-shadow: var(--tn-shadow); padding: 14px 16px; min-width: 0; }
.tn-block-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.tn-block-head .tn-row-icon { width: 32px; height: 32px; border-radius: 10px; }
.tn-block-head h3 { margin: 0; flex: 1; font-size: 13.5px; font-weight: 700; color: var(--tn-navy); }
.tn-facts { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; font-size: 12.5px; }
.tn-facts dt { color: var(--tn-muted); }
.tn-facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.tn-block-empty { margin: 0; font-size: 12px; line-height: 1.5; color: var(--tn-muted); }
.tn-block-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tn-block-list li { display: flex; align-items: center; gap: 10px; }
.tn-block-list form { display: contents; }
.tn-block-list-text { flex: 1; min-width: 0; }
.tn-block-list-text b { display: block; font-size: 12.5px; font-weight: 600; }
.tn-block-list-text > span { display: block; font-size: 11.5px; color: var(--tn-muted); }
.tn-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: var(--tn-sunken);
  color: var(--tn-soft);
  vertical-align: 1px;
}
.tn-badge-hot { background: var(--tn-accent); color: #fff; }
.tn-badge-good { background: var(--tn-good); color: #fff; }

@media (max-width: 1040px) {
  .tn-blocks { grid-template-columns: minmax(0, 1fr); overflow: visible; }
}


/* ==================================================================== login */

/*
 * A tela das entradas (desenho C, 13/10/2026): moldura branca de cantos retos
 * sobre o fundo azulado, formulário à esquerda, o produto à direita, o botão
 * redondo da ponte entre os dois, e duas manchas de cor saindo da moldura.
 */
.tn-entry-page { background: #e9eef6; }
.tn-entry {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  overflow: hidden;
}
.tn-entry-accent { position: absolute; border-radius: 50%; pointer-events: none; }
.tn-entry-accent-1 { width: 360px; height: 360px; left: -180px; top: -120px; background: linear-gradient(135deg, var(--tn-accent), var(--tn-sky)); }
.tn-entry-accent-2 { width: 240px; height: 240px; right: -90px; bottom: -110px; background: linear-gradient(135deg, var(--tn-magenta), var(--tn-red)); }

.tn-entry-frame {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  min-height: min(660px, calc(100vh - 80px));
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  background: var(--tn-card);
  box-shadow: 0 30px 70px rgb(19 63 121 / 18%);
}

/* --- formulário */
.tn-entry-side { position: relative; display: flex; flex-direction: column; padding: 34px 56px 30px; }
.tn-entry-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: 0.02em; color: var(--tn-navy); }
.tn-entry-hello { margin: 60px 0 6px; font-size: 32px; font-weight: 300; color: #9aa8bd; letter-spacing: -0.01em; }
.tn-entry-hello b { font-weight: 700; color: var(--tn-ink); }
.tn-entry-lead { margin: 0 0 30px; color: var(--tn-muted); font-size: 14px; line-height: 1.55; max-width: 300px; }

/*
 * Os campos colados num bloco só, como na referência: um traço com as cores do
 * anel acende à esquerda do campo em que se está digitando. O rótulo continua
 * dentro do campo e sobe quando se digita (login.ts explica o porquê).
 */
.tn-entry-side .tn-form-tight { gap: 0; }
.tn-entry-side .tn-field-float {
  position: relative;
  border: 1px solid #e3e9f2;
  margin-top: -1px;
  background: var(--tn-card);
}
.tn-entry-side .tn-field-float:first-of-type { box-shadow: 0 14px 30px rgb(19 63 121 / 7%); }
.tn-entry-side .tn-field-float input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent; }
.tn-entry-side .tn-field-float:focus-within::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -1px;
  bottom: -1px;
  width: 3px;
  background: var(--tn-ring);
  z-index: 1;
}
.tn-entry-side .tn-field-hint { margin-top: 10px !important; }
.tn-entry-side .tn-form-tight > .tn-button,
.tn-entry-side .tn-form > .tn-button {
  align-self: flex-start;
  margin-top: 26px;
  height: 42px;
  padding: 0 34px;
  border-radius: 3px;
  background: var(--tn-navy);
}
.tn-entry-side .tn-button-flat { background: var(--tn-sunken); }
.tn-entry-foot { margin: auto 0 0; padding-top: 30px; font-size: 11.5px; color: var(--tn-muted); line-height: 1.6; }
.tn-entry-foot b { color: var(--tn-ink); }

/* --- o produto */
.tn-entry-art {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #e9f1fc 0%, #d4e3f7 55%, #c3d7f2 100%);
}
.tn-entry-o {
  position: absolute;
  right: -150px;
  top: -110px;
  width: 640px;
  height: 640px;
  filter: drop-shadow(0 30px 50px rgb(19 63 121 / 25%));
}
.tn-entry-card {
  position: absolute;
  z-index: 2;
  min-width: 220px;
  padding: 14px 18px;
  background: var(--tn-card);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgb(19 63 121 / 16%);
}
.tn-entry-card small { display: block; font-size: 11.5px; color: var(--tn-muted); }
.tn-entry-card b { display: block; margin-top: 3px; font-size: 15px; }
.tn-entry-card i { position: relative; display: block; height: 5px; margin-top: 10px; border-radius: 3px; background: #e4ebf5; overflow: hidden; }
.tn-entry-card i::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--c); border-radius: 3px; }
.tn-entry-card-1 { left: 60px; top: 23%; }
.tn-entry-card-2 { left: 120px; top: 46%; }
.tn-entry-card-3 { left: 40px; top: 69%; }

/* --- a ponte: entra no sistema, como o botão Entrar */
.tn-entry-bridge {
  position: absolute;
  left: 430px;
  top: 50%;
  z-index: 3;
  width: 64px;
  height: 64px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  background: conic-gradient(from 200deg, #b72e58, #ff7a2e, #ffa32d, #4dac95, #469aab, #1e59b0, #b72e58);
  box-shadow: 0 14px 30px rgb(19 63 121 / 30%);
}
.tn-entry-bridge::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--tn-card); transition: background-color 140ms ease; }
.tn-entry-bridge svg { position: relative; z-index: 1; fill: none; stroke: var(--tn-navy); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.tn-entry-bridge:hover::after { background: var(--tn-navy); }
.tn-entry-bridge:hover svg { stroke: #fff; }
.tn-entry-bridge:focus-visible { outline: 2px solid var(--tn-accent); outline-offset: 3px; }

@media (max-width: 900px) {
  .tn-entry { padding: 0; }
  .tn-entry-frame { grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
  .tn-entry-art, .tn-entry-bridge, .tn-entry-accent { display: none; }
  .tn-entry-side { padding: 28px 24px; }
}

/* ==================================================================== painel */

/*
 * A tela inicial, no desenho escolhido: tres cards de numero, o grafico da
 * semana e a regua de cobranca na coluna da esquerda; o mostrador da
 * adimplencia e quem vence hoje na da direita.
 */
.tn-dash { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 18px; }

.tn-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tn-kpi {
  display: block;
  padding: 15px 18px 16px;
  background: var(--tn-card);
  border-radius: 20px;
  box-shadow: var(--tn-shadow);
  color: inherit;
  text-decoration: none;
  transition: box-shadow 140ms ease, transform 140ms ease;
}
a.tn-kpi:hover { box-shadow: var(--tn-shadow-lift); transform: translateY(-1px); }
.tn-kpi-head { display: flex; justify-content: space-between; align-items: flex-start; }
.tn-kpi-more { color: var(--tn-muted); }
.tn-kpi-label { margin: 10px 0 0; font-size: 13px; color: var(--tn-soft); }
.tn-kpi-value { display: flex; align-items: baseline; gap: 8px; margin-top: 1px; }
.tn-kpi-value b { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tn-kpi-value span { font-size: 13px; color: var(--tn-muted); font-variant-numeric: tabular-nums; }
.tn-kpi-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; }
.tn-kpi-meta b { font-weight: 700; }
.tn-kpi-meta span { color: var(--tn-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Quadrado de icone: as cores sao as do anel, uma por assunto. */
.tn-badge-icon {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--tn-accent), var(--tn-sky));
}
.tn-badge-icon .tn-icon { width: 21px; height: 21px; stroke-width: 2; }
.tn-badge-orange { background: linear-gradient(135deg, #ff7a2e, var(--tn-yellow)); }
.tn-badge-magenta { background: linear-gradient(135deg, var(--tn-magenta), #f0605e); }
.tn-badge-teal { background: linear-gradient(135deg, var(--tn-teal), var(--tn-green)); }

/* Barra com bolinha na ponta, como na referencia. */
.tn-bar { position: relative; height: 6px; margin-top: 8px; border-radius: 3px; background: #e4ebf5; }
.tn-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: currentColor; }
.tn-bar i::after {
  content: '';
  position: absolute;
  right: -6px;
  top: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid currentColor;
  box-sizing: border-box;
}
.tn-bar-green { color: var(--tn-green); }
.tn-bar-orange { color: var(--tn-orange); }
.tn-bar-magenta { color: var(--tn-magenta); }
.tn-bar-blue { color: var(--tn-accent); }

/* --- grafico */
.tn-chart {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  padding: 16px 20px 10px;
  background: var(--tn-card);
  border-radius: 20px;
  box-shadow: var(--tn-shadow);
}
.tn-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.tn-chart-head h2 { font-size: 15px; }
.tn-chart-head p { margin: 2px 0 0; font-size: 12px; color: var(--tn-muted); }
.tn-legend { display: flex; gap: 16px; align-items: center; font-size: 12px; color: var(--tn-muted); }
.tn-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tn-plot { position: relative; min-height: 120px; }
.tn-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

/* --- regua de cobranca */
.tn-flows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.tn-flow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--tn-card);
  border-radius: 18px;
  box-shadow: var(--tn-shadow);
  color: inherit;
  text-decoration: none;
  min-width: 0;
}
a.tn-flow:hover { box-shadow: var(--tn-shadow-lift); }
.tn-flow-text { flex: 1; min-width: 0; }
.tn-flow-text b { display: block; font-size: 13px; }
.tn-flow-text span { display: block; font-size: 12px; color: var(--tn-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-faces { display: flex; flex: none; }
.tn-faces i {
  width: 28px;
  height: 28px;
  margin-left: -8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--tn-card);
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--tn-accent);
}
.tn-faces i:first-child { margin-left: 0; }
.tn-faces i:nth-child(2) { background: var(--tn-teal); }
.tn-faces i:nth-child(3) { background: var(--tn-orange); }
.tn-faces .tn-faces-more { background: var(--tn-sunken); color: var(--tn-ink); }
.tn-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--tn-muted); }
.tn-dot-on { background: var(--tn-good); box-shadow: 0 0 0 4px rgb(29 134 86 / 18%); }
.tn-dot-off { background: var(--tn-bad); box-shadow: 0 0 0 4px rgb(192 57 43 / 16%); }

/* --- o mostrador */
.tn-hero-wrap { position: relative; padding: 8px 14px 0 0; flex: none; }
.tn-hero-wrap::before,
.tn-hero-wrap::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 6px;
  left: 0;
  right: 14px;
  border-radius: 22px;
}
.tn-hero-wrap::before { background: var(--tn-teal); transform: translate(12px, -4px) rotate(5deg); }
.tn-hero-wrap::after { background: var(--tn-orange); transform: translate(6px, -2px) rotate(2.5deg); }
.tn-hero {
  position: relative;
  z-index: 1;
  padding: 18px 22px 18px;
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 85% 0%, rgb(93 146 206 / 55%), transparent 60%),
    linear-gradient(160deg, #1e59b0 0%, #133f79 55%, #0d2e5c 100%);
  box-shadow: 0 20px 40px rgb(13 46 92 / 35%);
}
.tn-hero-title { display: flex; justify-content: space-between; font-size: 13px; color: rgb(255 255 255 / 85%); }
.tn-ring-box { position: relative; margin: 10px auto 12px; width: 150px; height: 150px; }
.tn-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 16px), #000 calc(100% - 15px));
}
.tn-ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.tn-ring-label b { display: block; font-size: 32px; font-weight: 800; line-height: 1; }
.tn-ring-label span { font-size: 12px; color: rgb(255 255 255 / 85%); }
.tn-hero-nums { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.tn-hero-nums span { color: rgb(255 255 255 / 80%); }
.tn-hero-nums b { display: block; font-size: 16px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tn-hero-nums div:last-child { text-align: right; }

/* --- lista da direita: quem vence hoje */
/* Rolagem só na vertical: os cartões inclinados atrás do mostrador e a sombra
   dos cards passam um pouco da coluna, e isso não pode virar barra de lado. */
.tn-people { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 2px 4px 4px 2px; }
.tn-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--tn-card);
  border-radius: 16px;
  box-shadow: var(--tn-shadow);
  color: inherit;
  text-decoration: none;
  flex: none;
}
a.tn-person:hover { box-shadow: var(--tn-shadow-lift); }
.tn-initials {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--tn-accent), var(--tn-sky));
}
.tn-initials-1 { background: linear-gradient(135deg, var(--tn-teal), var(--tn-green)); }
.tn-initials-2 { background: linear-gradient(135deg, #ff7a2e, var(--tn-yellow)); }
.tn-initials-3 { background: linear-gradient(135deg, var(--tn-magenta), #f0605e); }
.tn-person-text { flex: 1; min-width: 0; }
.tn-person-text b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-person-text span { display: block; font-size: 12px; color: var(--tn-muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Selo de estado: cheio, letra branca, a palavra sempre junto. */
.tn-chip {
  display: inline-block;
  flex: none;
  padding: 3px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--tn-muted);
  white-space: nowrap;
}
.tn-chip-good { background: var(--tn-good); }
.tn-chip-warn { background: var(--tn-warn); }
.tn-chip-bad { background: var(--tn-bad); }
.tn-chip-info { background: var(--tn-accent); }

/* ================================================================== mensagem */

/* O texto da mensagem, como sai no WhatsApp. */
.tn-bubble {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px 12px 12px 4px;
  background: #e7f6ee;
  color: var(--tn-ink);
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tn-tokens { display: flex; flex-wrap: wrap; gap: 6px; }
.tn-tokens code {
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--tn-sunken);
  color: var(--tn-navy);
  font: 600 11.5px/1.6 Consolas, 'Cascadia Mono', monospace;
}

/* ================================================================= estreito */

@media (max-width: 1180px) {
  .tn-flows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tn-top { grid-template-columns: minmax(0, 1fr) auto; }
  .tn-who { display: none; }
}

@media (max-width: 1040px) {
  .tn-cols { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .tn-aside { flex-direction: row; flex-wrap: wrap; overflow: visible; }
  .tn-aside > * { flex: 1 1 220px; }
  .tn-aside > .tn-cap { flex-basis: 100%; }
  .tn-dash { grid-template-rows: auto 300px auto; }
  .tn-blocks { grid-template-columns: minmax(0, 1fr); overflow: visible; }
}

@media (max-width: 720px) {
  .tn-app { display: block; height: auto; min-height: 100vh; margin: 0; border-radius: 0; }
  .tn-app::before { display: none; }
  .tn-rail { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--tn-line); padding: 8px 10px; overflow-x: auto; }
  .tn-rail-brand { display: none; }
  .tn-rail-item.tn-current::after { display: none; }
  .tn-rail-grow, .tn-rail-version { display: none; }
  .tn-main { height: auto; padding: 16px 14px 30px; }
  .tn-top { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .tn-search { width: 100%; }
  .tn-feed { overflow: visible; }
  .tn-strip, .tn-kpis, .tn-flows { display: flex; flex-direction: column; }
  .tn-row-date { display: none; }
  .tn-row-amount { width: auto; }
  .tn-pair { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================ peças do Topnet */

/* --- caixa de marcar no desenho do sistema. O checkbox nativo continua la
   (e e ele que o formulario envia); so o desenho e nosso. */
.tn-check { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; user-select: none; }
.tn-check input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border-radius: 6px;
  border: 2px solid #c3d3ea;
  background: var(--tn-card);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.tn-check input::after {
  content: '';
  width: 10px;
  height: 6px;
  border: solid #fff;
  border-width: 0 0 2.5px 2.5px;
  transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform 120ms ease;
}
.tn-check input:checked { background: var(--tn-accent); border-color: var(--tn-accent); }
.tn-check input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.tn-check input:focus-visible { outline: 2px solid var(--tn-accent); outline-offset: 2px; }

/* --- titulo de bloco dentro do formulario longo do cliente */
.tn-form > .tn-cap { margin: 6px 0 -4px; }
.tn-form > .tn-cap:first-child { margin-top: 0; }

/* --- a regua: um cartao por passo, com a mensagem de exemplo */
.tn-rules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; flex: none; }
.tn-rule {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--tn-card);
  border-radius: 18px;
  box-shadow: var(--tn-shadow);
  min-width: 0;
}
.tn-rule-head { display: flex; align-items: center; gap: 12px; }
.tn-rule-head .tn-badge-icon { width: 38px; height: 38px; border-radius: 11px; }
.tn-rule-title { flex: 1; min-width: 0; }
.tn-rule-title b { display: block; font-size: 13.5px; }
.tn-rule-title span { display: block; font-size: 11.5px; color: var(--tn-muted); }
.tn-rule-off { box-shadow: none; background: var(--tn-sunken); }
.tn-rule-off .tn-bubble { opacity: 0.6; }
.tn-rule-off .tn-badge-icon { filter: grayscale(1); opacity: 0.6; }

/* --- configuracoes: um cartao por integracao */
.tn-integrations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; flex: none; }
.tn-integration {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--tn-card);
  border-radius: 18px;
  box-shadow: var(--tn-shadow);
  min-width: 0;
}
.tn-integration-head { display: flex; align-items: center; gap: 12px; }
.tn-integration-head b { display: block; font-size: 14px; }
.tn-integration-head span { display: block; font-size: 11.5px; color: var(--tn-muted); }
.tn-integration p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--tn-soft); }
.tn-integration .tn-button { align-self: flex-start; margin-top: auto; }
.tn-integration-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

@media (max-width: 1180px) {
  .tn-rules, .tn-integrations { grid-template-columns: minmax(0, 1fr); }
}
