/* ============================================================
   GESTOR FINANCEIRO PRO — style.css
   Versão limpa: sem duplicações, sem conflitos de media query.
   Desktop: sidebar fixa à esquerda (260px).
   Mobile (≤768px): sidebar vira bottom navbar (64px).

   ATUALIZAÇÃO — HISTÓRICO FILTRÁVEL + EDIÇÃO/EXCLUSÃO DE TRANSAÇÃO:
   Adicionadas .history-filters (barra de filtros de período acima do
   histórico) e .transaction-value-actions/.transaction-actions/
   .btn-transaction-edit/.btn-transaction-delete (botões ✏️/🗑️ por
   transação). Ver blocos correspondentes nos media queries também.

   ATUALIZAÇÃO — .categoria-sugestao-ia ganhou white-space: pre-line
   para suportar o aviso multi-linha de "já existe uma categoria
   parecida" (ver categoria-personalizada.js).

   ATUALIZAÇÃO — CAMPO DE MENSAGEM: o botão "Enviar" herdava
   `.btn--primary { width: 100% }` dentro de um flex e esmagava o
   textarea até sobrar só a barra de rolagem. Agora o botão tem
   largura automática e o textarea ocupa o resto da linha, com altura
   mínima de 3 linhas (cresce sozinho até ~6, ver app.js).

   ATUALIZAÇÃO — ROLAGEM: overscroll-behavior: contain nos elementos
   roláveis e página travada com modal aberto (logo abaixo do reset).
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Rolagem presa no elemento ─────────────────────────────────
   Ao chegar no fim de uma lista rolável (modal, mensagens, seletor
   de categoria, tabela de importação, menu), a rolagem não "vaza"
   mais para a página de trás. */
.modal,
.modal__content,
.mensagens-lista,
.custom-select__panel,
.import-review__table-wrapper,
.sidebar,
textarea {
  overscroll-behavior: contain;
}

/* Com qualquer modal aberto, a página de trás fica parada. */
body:has(.modal:not(.hidden)) {
  overflow: hidden;
}

/* ── Variáveis ──────────────────────────────────────────────── */
:root {
  --bg-root:      #0f0f1e;
  --bg-surface:   #1a1a2e;
  --bg-card:      rgba(26, 26, 46, 0.8);
  --border:       rgba(100, 150, 255, 0.2);
  --accent:       #6495ff;
  --accent-2:     #4a7dff;
  --green:        #64ff7a;
  --red:          #ff6464;
  --cyan:         #64c8ff;
  --text-primary: #e0e0e0;
  --text-mid:     #a0a0b0;
  --text-muted:   #6b7c8f;
  --radius:       8px;
  --radius-lg:    15px;
  --transition:   0.3s ease;
  --sidebar-w:    260px;
  --navbar-h:     64px;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, var(--bg-root) 0%, var(--bg-surface) 100%);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
  /* Anti-flicker: começa invisível; JS remove via body.app-ready */
  visibility: hidden;
}

/* Removido pelo UIModule.showScreen() após a tela correta ser definida */
body.app-ready {
  visibility: visible;
}

/* ══════════════════════════════════════════════════════════════
   SISTEMA DE TELAS (LOGIN / REGISTER / ONBOARDING)
   ══════════════════════════════════════════════════════════════ */

.app-container {
  width: 100%;
  min-height: 100vh;
}

.screen {
  display: none;
  width: 100%;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

/* CRÍTICO: garante que telas inativas nunca vençam o display:none,
   independentemente de outras classes (ex: .layout-wrapper).
   Também esconde o sidebar fixo que poderia "vazar" para cima do login. */
.screen:not(.active) {
  display: none !important;
}

.screen:not(.active) .sidebar {
  display: none !important;
}

.screen--centered {
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* ── Login box ─────────────────────────────────────────────── */
.login-box {
  background: rgba(26, 26, 46, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(100, 150, 255, 0.3);
  border-radius: 20px;
  padding: 50px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.login-box__title {
  text-align: center;
  margin-bottom: 10px;
  font-size: 32px;
  color: #fff;
}

.login-box__subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 40px;
  font-size: 14px;
}

.login-box__toggle-text {
  text-align: center;
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.login-box__toggle-text a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.login-box__toggle-text a:hover {
  text-decoration: underline;
}

/* Erro inline no login */
.login-error {
  margin-top: 14px;
  padding: 12px 16px;
  background: rgba(255, 80, 80, 0.12);
  border: 1px solid rgba(255, 80, 80, 0.4);
  border-radius: var(--radius);
  color: #ff6b6b;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
  animation: fadeIn 0.25s ease;
}

.login-error.hidden {
  display: none;
}

/* ══════════════════════════════════════════════════════════════
   FORMULÁRIOS
   ══════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: 18px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 15px;
  background: rgba(26, 26, 46, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all var(--transition);
}

select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236495ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: rgba(20, 30, 60, 0.95);
  color: var(--accent);
  padding-right: 35px;
}

select option {
  background: #1a1f3a;
  color: var(--accent);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(100, 150, 255, 0.8);
  background: rgba(100, 150, 255, 0.08);
  box-shadow: 0 0 10px rgba(100, 150, 255, 0.18);
}

input::placeholder {
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════
   BOTÕES
   ══════════════════════════════════════════════════════════════ */

.btn {
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: all var(--transition);
  font-family: inherit;
}

.btn--primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  border-radius: var(--radius);
  font-size: 16px;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(100, 150, 255, 0.4);
}

.btn--secondary {
  padding: 10px 20px;
  background: rgba(100, 150, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(100, 150, 255, 0.4);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.btn--secondary:hover {
  background: rgba(100, 150, 255, 0.25);
}

/* ── Dropdown de categoria — 100% nosso, sem depender do picker
   nativo do sistema operacional. ── */
.custom-select {
  position: relative;
}

.custom-select__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  background: rgba(26, 26, 46, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.custom-select__trigger:hover:not(:disabled) {
  border-color: rgba(100, 150, 255, 0.6);
}

.custom-select__trigger.open {
  border-color: rgba(100, 150, 255, 0.8);
  box-shadow: 0 0 10px rgba(100, 150, 255, 0.18);
}

.custom-select__trigger:disabled {
  cursor: default;
  opacity: 0.65;
}

.custom-select__trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select__chevron {
  color: var(--accent);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform var(--transition);
}

.custom-select__trigger.open .custom-select__chevron {
  transform: rotate(180deg);
}

.custom-select__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: #14152a;
  border: 1px solid rgba(100, 150, 255, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  z-index: 10500;
  padding: 6px 0;
}

.custom-select__panel.hidden {
  display: none;
}

.custom-select__group-label {
  padding: 10px 15px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.custom-select__option {
  display: block;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 15px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.custom-select__option:hover,
.custom-select__option.selected {
  background: rgba(100, 150, 255, 0.15);
  color: var(--accent);
}

/* ── Link "+ Criar categoria personalizada" (form de transação) ── */
.btn-link-nova-categoria {
  display: inline-block;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 7px 0 0;
  font-family: inherit;
  text-align: left;
}

.btn-link-nova-categoria:hover {
  text-decoration: underline;
}

/* ── Painel de sugestão do classificador (modal Nova Categoria) ── */
.categoria-sugestao-ia {
  background: rgba(100, 150, 255, 0.08);
  border: 1px solid rgba(100, 150, 255, 0.25);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.5;
  /* Preserva as quebras de linha do aviso de "categoria já existe"
     (ver categoria-personalizada.js), sem precisar de <br> manual. */
  white-space: pre-line;
}

.btn--logout {
  padding: 10px 20px;
  background: rgba(255, 100, 100, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 100, 100, 0.4);
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.btn--logout:hover {
  background: rgba(255, 100, 100, 0.28);
}

.btn-delete {
  padding: 6px 12px;
  background: rgba(255, 100, 100, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 100, 100, 0.4);
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}

.btn-copy {
  padding: 6px 12px;
  background: rgba(100, 200, 255, 0.15);
  color: var(--cyan);
  border: 1px solid rgba(100, 200, 255, 0.4);
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
}

.btn-collapse {
  background: rgba(100, 150, 255, 0.12);
  border: 1px solid rgba(100, 150, 255, 0.25);
  color: var(--accent);
  padding: 12px 15px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  transition: all var(--transition);
  font-family: inherit;
}

.btn-collapse:hover {
  background: rgba(100, 150, 255, 0.22);
}

.collapse-icon {
  transition: transform var(--transition);
  font-size: 12px;
}

.collapse-content {
  margin-top: 14px;
  padding: 14px;
  background: rgba(100, 150, 255, 0.04);
  border-radius: var(--radius);
  border: 1px solid rgba(100, 150, 255, 0.12);
}

.collapse-content.hidden {
  display: none;
}

/* ══════════════════════════════════════════════════════════════
   MENSAGENS / ESTADOS
   ══════════════════════════════════════════════════════════════ */

.message {
  padding: 12px;
  border-radius: 6px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid;
  display: none;
}

.message--error   { color: var(--red);   background: rgba(255,100,100,0.08); border-left-color: var(--red); }
.message--success { color: var(--green); background: rgba(100,255,122,0.08); border-left-color: var(--green); }
.message.show     { display: block; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-style: italic;
}

.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT PÓS-LOGIN: SIDEBAR + MAIN
   ══════════════════════════════════════════════════════════════ */

.layout-wrapper {
  flex-direction: row;
  min-height: 100vh;
  width: 100%;
}

/* ── SIDEBAR — Desktop padrão ───────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: rgba(12, 12, 28, 0.97);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar__header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.sidebar__header h2 {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  margin-bottom: 14px;
}

.sidebar__nav-item {
  width: 100%;
  background: rgba(100, 150, 255, 0.07);
  border: 1px solid rgba(100, 150, 255, 0.12);
  color: var(--text-mid);
  padding: 11px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar__nav-item:hover {
  background: rgba(100, 150, 255, 0.16);
  color: var(--accent);
}

.sidebar__nav-item.active {
  background: linear-gradient(135deg, rgba(100, 150, 255, 0.26), rgba(100, 150, 255, 0.09));
  color: var(--accent);
  border-color: rgba(100, 150, 255, 0.42);
}

.sidebar__nav-item--profile {
  margin-top: auto;
}

.sidebar__nav-item--mensagens { position: relative; }

.mensagens-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ── Mensagens — Fale com o Administrador ─────────────────────── */
.mensagens-card { display: flex; flex-direction: column; }

.mensagens-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 460px;
  min-height: 220px;
  overflow-y: auto;
  padding: 12px;
  margin-bottom: 15px;
  background: rgba(10, 10, 24, 0.35);
  border: 1px solid rgba(100, 150, 255, 0.1);
  border-radius: var(--radius);
}

.mensagens-lista .empty-state {
  margin: auto 0;
}

.mensagem-bolha {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.mensagem-bolha__texto { white-space: pre-wrap; word-break: break-word; }
.mensagem-bolha__hora { display: block; margin-top: 4px; font-size: 10.5px; opacity: 0.7; }

.mensagem-bolha--cliente {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.mensagem-bolha--admin {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Linha de envio: textarea ocupa o espaço, botão fica do tamanho do
   próprio texto (NÃO herda o width:100% de .btn--primary). */
.mensagens-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  width: 100%;
}

.mensagens-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  min-height: 76px;
  max-height: 160px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
}

.mensagens-form textarea:focus { border-color: var(--accent); }

.mensagens-form .btn,
.mensagens-form .btn--primary {
  flex: 0 0 auto;
  width: auto;
  min-width: 110px;
  height: 46px;
  padding: 0 22px;
  font-size: 14px;
}

.mensagens-form .btn--primary:hover { transform: none; }

.mensagens-form__dica {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Separador de dia na conversa ("Hoje", "Ontem", 12/09/2026) */
.mensagem-dia {
  align-self: center;
  margin: 6px 0 2px;
  padding: 3px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  background: rgba(100, 150, 255, 0.08);
  border: 1px solid rgba(100, 150, 255, 0.15);
  border-radius: 999px;
}

/* Conversa vazia: convite + sugestões clicáveis */
.mensagens-vazio {
  margin: auto 0;
  text-align: center;
  padding: 16px 8px;
}

.mensagens-vazio__titulo {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.mensagens-vazio__texto {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 14px;
}

.mensagens-sugestoes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.mensagens-sugestao {
  background: rgba(100, 150, 255, 0.1);
  border: 1px solid rgba(100, 150, 255, 0.3);
  color: var(--accent);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition);
}

.mensagens-sugestao:hover { background: rgba(100, 150, 255, 0.2); }

.sidebar__risk-block,
.sidebar__plan-block {
  margin: 6px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(100, 149, 255, 0.1);
}

.sidebar__block-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.risk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.risk-bar {
  width: 24px;
  height: 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.risk-row--verde   .risk-bar  { background: #4ade80; }
.risk-row--amarelo .risk-bar  { background: #facc15; }
.risk-row--vermelho .risk-bar { background: #f87171; }

.risk-label { font-size: 12px; flex: 1; }

.risk-row--verde   .risk-label  { color: #4ade80; }
.risk-row--amarelo .risk-label  { color: #facc15; }
.risk-row--vermelho .risk-label { color: #f87171; }

.risk-count {
  font-size: 13px;
  font-weight: 700;
  color: #e8eaf6;
  min-width: 18px;
  text-align: right;
}

.risk-subtitle {
  font-size: 10px;
  color: #4a5568;
  margin-top: 6px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.plan-stat__label { font-size: 12px; color: var(--text-muted); }
.plan-stat__value { font-size: 13px; font-weight: 700; color: var(--accent); }

/* ── MAIN CONTENT — Desktop ─────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

/* ══════════════════════════════════════════════════════════════
   COMPONENTES PÓS-LOGIN
   ══════════════════════════════════════════════════════════════ */

.client-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.client-header h1 {
  font-size: 28px;
  color: #fff;
  margin-bottom: 4px;
}

.client-header p {
  color: var(--text-muted);
  font-size: 14px;
}

.view-section {
  display: none;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.view-section.active {
  display: flex;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.section-header h2 {
  font-size: 22px;
  color: #fff;
}

/* ── Card base ──────────────────────────────────────────────── */
.card {
  background: rgba(26, 26, 46, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card h3 {
  margin-bottom: 18px;
  color: #fff;
  font-size: 17px;
}

.card.hidden { display: none; }

/* Cabeçalho de card com um botão de colapsar ao lado do título (ex:
   Histórico de transações) — mantém o h3 e o botão na mesma linha. */
.card__header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.card__header-row h3 {
  margin-bottom: 0;
}

/* ── Grids de resumo financeiro ─────────────────────────────── */
.resume-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.resume-item {
  background: rgba(100, 150, 255, 0.07);
  padding: 20px;
  border-radius: 10px;
  border-left: 4px solid;
}

.resume-item.receita { border-left-color: var(--green); }
.resume-item.despesa { border-left-color: var(--red); }
.resume-item.saldo   { border-left-color: var(--accent); }

.resume-item .label {
  display: block;
  color: var(--text-mid);
  font-size: 13px;
  margin-bottom: 8px;
}

.resume-item .value {
  display: block;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

/* ── BI Grid ─────────────────────────────────────────────────── */
.bi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.bi-item {
  background: rgba(100, 150, 255, 0.05);
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.bi-label  { display: block; color: var(--text-mid); font-size: 12px; margin-bottom: 7px; font-weight: 600; }
.bi-value  { display: block; color: var(--accent); font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.bi-detail { display: block; color: var(--text-muted); font-size: 11px; }

/* ── CTA "Definir Meta de Gastos" (aparece se não há metas) ──── */
.meta-cta-card {
  background: linear-gradient(135deg, rgba(100, 150, 255, 0.14), rgba(100, 200, 255, 0.08));
  border: 1px solid rgba(100, 150, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.meta-cta-card__texto h3 { margin-bottom: 6px; }
.meta-cta-card__texto p { color: var(--text-mid); font-size: 13px; max-width: 420px; }
.meta-cta-card .btn--primary { white-space: nowrap; flex-shrink: 0; }

/* ── Maiores Gastos do Período — cartões com ícone ────────────── */
.gasto-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.gasto-icon-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(100, 150, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: var(--transition);
}

.gasto-icon-card:hover { border-color: rgba(100, 150, 255, 0.4); background: rgba(100, 150, 255, 0.09); }

.gasto-icon-card__icone {
  font-size: 26px;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(100, 150, 255, 0.12);
  border-radius: var(--radius);
}

.gasto-icon-card__corpo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gasto-icon-card__nome { font-size: 13px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gasto-icon-card__valor { font-size: 15px; font-weight: 800; color: var(--red); }
.gasto-icon-card__percentual { font-size: 11px; color: var(--text-muted); }

/* ── Filters (genérico — admin/razonete) ────────────────────── */
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}

/* ── Filtros de período (Histórico E Dashboard) ────────────────
   Reaproveitada tanto pela barra de filtros do Histórico
   (cli-transactions) quanto pela barra de filtros do Dashboard
   (cli-dashboard, ver client.html/index.html + app.js
   initDashboardFilters). Layout em grid que se adapta ao número de
   campos visíveis; vira coluna única no mobile (ver media query). */
.history-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.history-filters .form-group {
  margin-bottom: 0;
}

.history-filters__custom-range {
  display: contents;
}

.history-filters__custom-range.hidden {
  display: none;
}

/* Mesma barra de filtros, mas usada acima do Resumo do Mês/Análise
   Financeira do Dashboard — sem a borda inferior (não há lista longa
   logo abaixo dela dentro do mesmo card). */
.dashboard-filters {
  margin-bottom: 18px; /* mesmo respiro do botão "+ Adicionar Meta" até o bloco seguinte */
  padding-bottom: 0;
  border-bottom: none;
}

/* ── Importação de Extrato (OFX/CSV) — status + tabela de revisão ── */
.import-status {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(100, 150, 255, 0.08);
  border: 1px solid rgba(100, 150, 255, 0.25);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.5;
}

.import-status.import-status--error {
  background: rgba(255, 100, 100, 0.08);
  border-color: rgba(255, 100, 100, 0.3);
  color: #ff8f8f;
}

.import-review {
  margin-top: 18px;
}

.import-review__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.import-review__header h4 {
  color: #fff;
  font-size: 15px;
}

.import-review__select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-mid);
  cursor: pointer;
  user-select: none;
}

.import-review__select-all input {
  width: auto;
}

.import-review__table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 420px;
  overflow-y: auto;
}

.import-review__table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
}

.import-review__table thead th {
  position: sticky;
  top: 0;
  background: #14152a;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  z-index: 1;
}

.import-review__table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(100, 150, 255, 0.08);
  vertical-align: middle;
  white-space: nowrap;
}

.import-review__table tbody tr:last-child td {
  border-bottom: none;
}

.import-review__table tbody tr.import-row--duplicada {
  opacity: 0.55;
}

.import-review__table tbody tr.import-row--excluida td {
  text-decoration: line-through;
  opacity: 0.4;
}

.import-review__table input[type="text"],
.import-review__table input[type="number"],
.import-review__table input[type="date"],
.import-review__table select {
  padding: 6px 8px;
  font-size: 12.5px;
  min-width: 110px;
}

.import-review__table input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.import-review__table .import-descricao-input {
  min-width: 160px;
}

.import-review__origem-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.import-review__origem-badge--aprendida  { background: rgba(0, 245, 160, 0.14); color: #4ade80; }
.import-review__origem-badge--local      { background: rgba(100, 150, 255, 0.14); color: var(--accent); }
.import-review__origem-badge--manual     { background: rgba(255, 180, 67, 0.14); color: #ffb443; }
.import-review__origem-badge--duplicada  { background: rgba(107, 158, 132, 0.14); color: var(--text-muted); }

/* Selo clicável — mostra qual sinônimo/regra reconheceu a descrição
   (toque no mobile, clique no PC). Herda tudo do selo comum, só troca
   <span> por <button> e adiciona affordance de clique. */
.import-review__origem-badge--clicavel {
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.import-review__origem-badge--clicavel:hover,
.import-review__origem-badge--clicavel:active { filter: brightness(1.15); }

.import-review__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.import-review__actions .btn {
  width: auto;
  padding: 11px 22px;
}

/* ── Transactions ────────────────────────────────────────────── */
.transactions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transaction-item {
  background: rgba(100, 150, 255, 0.04);
  padding: 14px;
  border-radius: var(--radius);
  border-left: 4px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.transaction-item.receita { border-left-color: var(--green); }
.transaction-item.despesa { border-left-color: var(--red); }

.transaction-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.transaction-description { color: var(--text-primary); font-weight: 600; font-size: 14px; }
.transaction-category    { color: var(--text-muted); font-size: 12px; }
.transaction-date        { color: var(--text-muted); font-size: 11px; }

.transaction-value-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

.transaction-value {
  font-size: 16px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.transaction-value.receita { color: var(--green); }
.transaction-value.despesa { color: var(--red); }

.transaction-actions {
  display: flex;
  gap: 6px;
}

.btn-transaction-edit,
.btn-transaction-delete {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  font-family: inherit;
}

.btn-transaction-edit {
  background: rgba(100, 150, 255, 0.1);
  border: 1px solid rgba(100, 150, 255, 0.25);
}

.btn-transaction-edit:hover {
  background: rgba(100, 150, 255, 0.22);
}

.btn-transaction-delete {
  background: rgba(255, 100, 100, 0.1);
  border: 1px solid rgba(255, 100, 100, 0.25);
}

.btn-transaction-delete:hover {
  background: rgba(255, 100, 100, 0.22);
}

.btn-transaction-edit:active,
.btn-transaction-delete:active {
  transform: scale(0.94);
}

/* ── Clients grid ───────────────────────────────────────────── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.client-item {
  background: rgba(100, 150, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.client-item:hover {
  background: rgba(100, 150, 255, 0.12);
  border-color: rgba(100, 150, 255, 0.4);
}

.client-name  { color: #fff; font-size: 17px; font-weight: 700; }
.client-email { color: var(--text-muted); font-size: 13px; }

.client-link {
  background: rgba(100, 200, 255, 0.07);
  border: 1px solid rgba(100, 200, 255, 0.22);
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  color: var(--cyan);
  word-break: break-all;
  font-family: monospace;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.client-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.client-card {
  background: #141a2e;
  border: 1px solid rgba(100, 149, 255, 0.15);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.2s, transform 0.2s;
}

.client-card:hover {
  border-color: rgba(100, 149, 255, 0.4);
  transform: translateY(-2px);
}

.client-card[data-risk="verde"]    { border-top: 3px solid #4ade80; }
.client-card[data-risk="amarelo"]  { border-top: 3px solid #facc15; }
.client-card[data-risk="vermelho"] { border-top: 3px solid #f87171; }

.client-card__name    { font-size: 15px; font-weight: 700; color: #e8eaf6; }
.client-card__email   { font-size: 12px; color: var(--text-muted); }
.client-card__risk    { font-size: 13px; font-weight: 600; }
.client-card__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.cc-btn {
  padding: 8px 4px;
  border: none;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}

.cc-btn:hover  { opacity: 0.85; transform: translateY(-1px); }
.cc-btn:active { transform: translateY(0); }

.cc-btn--edit   { background: rgba(100, 149, 255, 0.16); color: #6495ff; }
.cc-btn--note   { background: rgba(100, 149, 255, 0.16); color: #6495ff; }
.cc-btn--delete { background: rgba(248, 113, 113, 0.14); color: #f87171; }
.cc-btn--plan   { background: rgba(74, 222, 128, 0.11);  color: #4ade80; }

/* ── Admin main header ───────────────────────────────────────── */
.admin-main-header {
  padding: 20px 0;
  border-bottom: 1px solid rgba(100, 149, 255, 0.1);
  margin-bottom: 24px;
}

.admin-main-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: #e8eaf6;
}

.admin-header-sub         { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.admin-header-sub span    { color: var(--accent); font-weight: 700; }

/* ── Metas ───────────────────────────────────────────────────── */
.metas-client-grid,
.metas-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.meta-card {
  background: rgba(100, 150, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all var(--transition);
}

.meta-card:hover {
  background: rgba(100, 150, 255, 0.12);
  border-color: rgba(100, 150, 255, 0.4);
}

.meta-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.meta-nome   { font-size: 15px; font-weight: 700; color: #fff; }
.meta-client { font-size: 12px; color: var(--accent); font-weight: 600; }

/* ── Ações (editar/excluir) no cartão de meta do cliente ──────── */
.meta-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

.btn-meta-mini {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
}
.btn-meta-mini.editar:hover  { border-color: var(--accent); }
.btn-meta-mini.excluir:hover { border-color: var(--red); background: rgba(255, 100, 100, 0.1); }

/* ── Dica/tutorial — Metas (explica o vínculo Investimento -> Meta) ── */
.meta-dica-box {
  background: rgba(100, 150, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 15px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-primary);
}
.meta-dica-box strong { color: var(--accent); }

.meta-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(100, 150, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.meta-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width var(--transition);
}

.meta-info {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 10px;
  background: rgba(100, 150, 255, 0.04);
  border-radius: 6px;
}

.meta-info-item  { text-align: center; }
.meta-info-label { color: var(--text-muted); font-size: 11px; display: block; }
.meta-info-value { color: var(--accent); font-weight: 700; font-size: 13px; margin-top: 3px; display: block; }

/* ── Planning ────────────────────────────────────────────────── */
.planning-requests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.planning-request-card {
  background: rgba(100, 150, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all var(--transition);
}

.planning-request-card:hover {
  background: rgba(100, 150, 255, 0.12);
  border-color: rgba(100, 150, 255, 0.4);
}

.planning-request-name { font-size: 15px; font-weight: 700; color: #fff; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 16px;
}

.modal.hidden { display: none; }

.modal__content {
  background: rgba(26, 26, 46, 0.97);
  border: 1px solid rgba(100, 150, 255, 0.28);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.modal__header h2 { color: #fff; margin: 0; font-size: 18px; }

.modal__close-btn {
  background: rgba(255, 100, 100, 0.15);
  color: var(--red);
  border: 1px solid rgba(255, 100, 100, 0.4);
  border-radius: 5px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
}

.modal__close-btn:hover { background: rgba(255, 100, 100, 0.28); }

.modal__body { padding: 24px; }

/* ══════════════════════════════════════════════════════════════
   ANIMAÇÕES
   ══════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVO — TABLET (769px – 1024px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }

  .resume-grid,
  .bi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .history-filters {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVO — MOBILE (≤ 768px)
   SIDEBAR → BOTTOM NAVBAR
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {

  /* Layout */
  .layout-wrapper {
    flex-direction: column;
  }

  /* ── SIDEBAR vira bottom navbar ─────────────────────────── */
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    top: auto;
    width: 100%;
    height: calc(var(--navbar-h) + env(safe-area-inset-bottom));
    min-width: unset;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px env(safe-area-inset-bottom);
    border-right: none;
    border-top: 1px solid rgba(100, 200, 255, 0.12);
    border-radius: 16px 16px 0 0;
    background: rgba(10, 10, 24, 0.97);
    backdrop-filter: blur(14px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.55);
    overflow: visible;
    z-index: 9999;
  }

  .sidebar__header,
  .sidebar__risk-block,
  .sidebar__plan-block {
    display: none;
  }

  .sidebar__nav {
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    flex: 1;
    height: 100%;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  .sidebar__nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    padding: 6px 2px 4px;
    background: transparent;
    border: none;
    border-radius: 0;
    color: rgba(140, 140, 170, 0.75);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    gap: 3px;
    cursor: pointer;
    transition: color var(--transition);
    text-align: center;
    position: relative;
  }

  .sidebar__nav-item::before {
    font-size: 20px;
    line-height: 1;
  }

  .sidebar__nav-item:hover {
    background: transparent;
    color: var(--cyan);
    transform: none;
  }

  .sidebar__nav-item.active {
    color: var(--cyan);
    background: transparent;
    border: none;
  }

  .sidebar__nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 7px rgba(100, 200, 255, 0.7);
  }

  .sidebar__nav-item--profile {
    margin-top: 0;
  }

  /* ── MAIN CONTENT com padding para navbar ────────────────── */
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 16px 14px calc(var(--navbar-h) + env(safe-area-inset-bottom) + 16px);
  }

  /* ── Ajustes de componentes pós-login ────────────────────── */
  .client-header h1 { font-size: 22px; }

  .resume-grid,
  .bi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metas-client-grid,
  .metas-admin-grid,
  .planning-requests-grid,
  .clients-grid {
    grid-template-columns: 1fr;
  }

  .filters    { grid-template-columns: 1fr; }
  .form-row   { grid-template-columns: 1fr; }

  .history-filters {
    grid-template-columns: 1fr;
  }

  .login-box {
    padding: 32px 22px;
  }

  .login-box__title { font-size: 26px; }

  .card { padding: 16px; }

  .transaction-item {
    flex-wrap: wrap;
    gap: 8px;
  }

  .transaction-value-actions {
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }

  .transaction-value {
    font-size: 14px;
  }

  .modal__content {
    max-width: 94%;
    max-height: 85vh;
    border-radius: var(--radius-lg);
  }

  .modal {
    align-items: center;
    padding: 16px;
  }

  .modal__header,
  .modal__body {
    padding: 16px;
  }

  /* Mensagens no celular: bolhas mais largas, botão compacto */
  .mensagens-lista { max-height: 55vh; }
  .mensagem-bolha  { max-width: 88%; }
  .mensagens-form .btn,
  .mensagens-form .btn--primary {
    min-width: 0;
    padding: 0 16px;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVO — MOBILE PEQUENO (≤ 480px)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  :root { --navbar-h: 58px; }

  .sidebar__nav-item {
    font-size: 9px;
  }

  .resume-grid,
  .bi-grid {
    grid-template-columns: 1fr;
  }

  .client-header h1 { font-size: 19px; }

  .card h3 { font-size: 15px; }

  .login-box { padding: 28px 18px; }
  .login-box__title { font-size: 23px; }
}


/* ══════════════════════════════════════════════════════════════
   AVISO DE IMPEDIMENTO DA IMPORTAÇÃO (dentro do modal)
   ══════════════════════════════════════════════════════════════ */
.import-aviso {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: rgba(255, 77, 109, 0.12);
  border: 1px solid rgba(255, 77, 109, 0.45);
  color: #ffb3c1;
  font-size: 0.85rem;
  line-height: 1.45;
  position: sticky;
  top: 0;
  z-index: 5;
}

.import-aviso.hidden { display: none; }
.import-aviso__icone { font-size: 1rem; line-height: 1.3; }
.import-aviso__texto { flex: 1 1 auto; }

.import-aviso__fechar {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  opacity: 0.7;
  flex-shrink: 0;
}
.import-aviso__fechar:hover { opacity: 1; }

/* Linha que travou a importação */
.import-row--impedida > td {
  background: rgba(255, 77, 109, 0.16) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.5);
}

/* ══════════════════════════════════════════════════════════════
   OLHINHO DE MOSTRAR SENHA (login / cadastro)
   ══════════════════════════════════════════════════════════════ */
.input-senha { position: relative; display: block; }

.input-senha input {
  width: 100%;
  /* espaço reservado pro botão não cobrir o texto digitado */
  padding-right: 44px !important;
}

.btn-ver-senha {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1rem;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.btn-ver-senha:hover,
.btn-ver-senha:focus-visible { opacity: 1; }

/* ══════════════════════════════════════════════════════════════
   PERFIL — avisos e som (som.js / notifications.js)
   ══════════════════════════════════════════════════════════════ */
.perfil-avisos {
  margin-top: 16px; padding: 16px;
  background: rgba(100, 150, 255, 0.06);
  border: 1px solid var(--border); border-radius: 8px;
  display: flex; flex-direction: column; gap: 10px;
}
.perfil-avisos__titulo { color: #fff; font-weight: 700; font-size: 14px; }
.perfil-avisos__btn { width: 100%; text-align: left; }
.perfil-avisos__btn:disabled { opacity: 0.75; cursor: default; }
.perfil-avisos__dica { color: var(--text-muted); font-size: 12px; line-height: 1.45; }

/* ══════════════════════════════════════════════════════════════
   GAMIFICAÇÃO — nível, sequência, saúde, missões, cofrinhos,
   evolução e conquistas (ver gamificacao.js)
   ══════════════════════════════════════════════════════════════ */
:root {
  --gami-ouro:    #fbbf24;
  --gami-bom:     #34d399;
  --gami-atencao: #fbbf24;
  --gami-critico: #f87171;
  --gami-receita: #1f9d8a;
  --gami-despesa: #e0663a;
}

.gami-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr) minmax(0, 1.4fr);
  gap: 16px;
}
.gami-hero:empty { display: none; }

.gami-card {
  background: rgba(26, 26, 46, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.35s ease both;
}
.gami-card:nth-child(2) { animation-delay: 0.05s; }
.gami-card:nth-child(3) { animation-delay: 0.1s; }

.gami-rotulo {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.gami-titulo { font-size: 18px; font-weight: 800; color: #fff; line-height: 1.25; }
.gami-sub { font-size: 12.5px; color: var(--text-mid); margin-top: 6px; line-height: 1.45; }
.gami-sub strong { color: #fff; }
.gami-sub--discreto { color: var(--text-muted); font-size: 11.5px; }

/* Nível */
.gami-nivel {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(100, 150, 255, 0.22), transparent 60%),
    rgba(26, 26, 46, 0.8);
}
.gami-nivel__topo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.gami-nivel__selo {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 900; color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(100, 150, 255, 0.35);
}
.gami-xp-total {
  margin-left: auto;
  font-size: 12px; font-weight: 700;
  color: var(--accent);
  background: rgba(100, 150, 255, 0.12);
  border: 1px solid rgba(100, 150, 255, 0.25);
  padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}

.gami-barra {
  height: 10px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.gami-barra__preenchimento {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(.2,.8,.2,1);
}
.gami-barra--fina { height: 6px; margin-top: 6px; }

/* Sequência */
.gami-sequencia__valor {
  display: flex; align-items: center; gap: 6px;
  font-size: 30px; font-weight: 900; color: #fff;
  margin: 4px 0 2px;
}
.gami-sequencia__fogo { font-size: 28px; animation: gamiChama 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.gami-sequencia--pendente .gami-sequencia__fogo { animation: none; filter: grayscale(0.7); opacity: 0.6; }
.gami-sequencia--pendente .gami-sub:first-of-type { color: var(--gami-ouro); font-weight: 600; }

@keyframes gamiChama {
  0%, 100% { transform: scale(1) rotate(-2deg); }
  50%      { transform: scale(1.12) rotate(3deg); }
}

/* Saúde do mês */
.gami-saude { display: flex; align-items: center; gap: 16px; }
.gami-anel { width: 84px; height: 84px; flex-shrink: 0; }
.gami-anel__trilho { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 8; }
.gami-anel__valor { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.gami-anel__valor--otima   { stroke: var(--gami-bom); }
.gami-anel__valor--boa     { stroke: var(--accent); }
.gami-anel__valor--atencao { stroke: var(--gami-atencao); }
.gami-anel__valor--critica { stroke: var(--gami-critico); }
.gami-anel__numero { fill: #fff; font-size: 22px; font-weight: 900; font-family: inherit; }
.gami-anel--vazio {
  display: grid; place-items: center;
  border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, 0.07);
  color: var(--text-muted); font-size: 20px; font-weight: 800;
}
.gami-saude__texto { min-width: 0; }
.gami-saude__label--otima   { color: var(--gami-bom); }
.gami-saude__label--boa     { color: var(--accent); }
.gami-saude__label--atencao { color: var(--gami-atencao); }
.gami-saude__label--critica { color: var(--gami-critico); }
.gami-delta { display: inline-block; font-size: 11.5px; font-weight: 700; margin-top: 2px; }
.gami-delta--sobe  { color: var(--gami-bom); }
.gami-delta--desce { color: var(--gami-critico); }

/* Blocos de seção (missões, cofrinhos, evolução, conquistas) */
.gami-duplo {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
}
.gami-secao-topo {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.gami-secao-topo h3 { margin: 0; }
.gami-secao-topo__dir { display: flex; align-items: center; gap: 10px; }

/* ══════════════════════════════════════════════════════════════
   TOUR DO PRIMEIRO ACESSO (tour.js)
   ══════════════════════════════════════════════════════════════ */
.modal__content.tour { max-width: 440px; }
.tour__corpo { text-align: center; padding: 30px 26px 24px; }
.tour__icone { font-size: 46px; line-height: 1; margin-bottom: 12px; }
.tour__titulo { color: #fff; font-size: 21px; margin-bottom: 10px; }
.tour__texto { color: var(--text-primary); font-size: 15px; line-height: 1.55; margin-bottom: 12px; }
.tour__dica {
  color: var(--text-mid); font-size: 13px; line-height: 1.5;
  background: rgba(100, 150, 255, 0.07); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px;
}
.tour__pontos { display: flex; justify-content: center; gap: 7px; margin: 18px 0; }
.tour__ponto { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.15); transition: background var(--transition), width var(--transition); }
.tour__ponto--ativo { width: 22px; border-radius: 999px; background: var(--accent); }
.tour__acoes { display: flex; gap: 10px; justify-content: center; }
.tour__acoes .btn { width: auto; min-width: 120px; padding: 11px 20px; font-size: 15px; }
.tour__acoes .btn--primary:hover { transform: none; }
.gami-contador {
  font-size: 12px; font-weight: 700; color: var(--text-mid);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 999px;
}
.gami-link {
  background: none; border: none; color: var(--accent);
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.gami-link:hover { text-decoration: underline; }
.gami-vazio { text-align: center; color: var(--text-mid); font-size: 13px; padding: 12px 0 4px; }
.gami-vazio p { margin-bottom: 12px; }

/* Missões */
.gami-missoes { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.gami-missao {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: rgba(100, 150, 255, 0.05);
  border: 1px solid rgba(100, 150, 255, 0.1);
  border-radius: 10px;
  transition: border-color var(--transition), background var(--transition);
}
.gami-missao:hover { border-color: rgba(100, 150, 255, 0.3); }
.gami-missao__icone { font-size: 22px; width: 32px; text-align: center; flex-shrink: 0; }
.gami-missao__corpo { flex: 1; min-width: 0; }
.gami-missao__titulo { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.gami-missao__detalhe { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }
.gami-missao__xp {
  font-size: 11.5px; font-weight: 800; color: var(--gami-ouro);
  white-space: nowrap; flex-shrink: 0;
}
.gami-missao__acao {
  background: var(--accent); color: #fff; border: none;
  border-radius: 6px; padding: 6px 10px; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.gami-missao__acao--sec {
  background: rgba(100, 150, 255, 0.12); color: var(--accent);
  border: 1px solid rgba(100, 150, 255, 0.35); white-space: nowrap;
}
.gami-missao--bloqueada { opacity: 0.55; }

/* Semanas em dia: botão "Nada a registrar" e link da semana passada */
.gami-checkin {
  margin-top: 10px; width: 100%;
  background: rgba(52, 211, 153, 0.1); color: var(--gami-bom);
  border: 1px solid rgba(52, 211, 153, 0.4); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  transition: background var(--transition);
}
.gami-checkin:hover { background: rgba(52, 211, 153, 0.18); }
.gami-link--pequeno { display: block; margin-top: 8px; font-size: 11.5px; text-align: left; padding: 0; }
.gami-missao--feita { background: rgba(52, 211, 153, 0.08); border-color: rgba(52, 211, 153, 0.3); }
.gami-missao--feita .gami-missao__titulo { color: var(--text-mid); text-decoration: line-through; }
.gami-missao--feita .gami-barra__preenchimento { background: var(--gami-bom); }
.gami-missao--falhou { opacity: 0.6; }
.gami-missao--falhou .gami-barra__preenchimento { background: var(--gami-critico); }
.gami-barra--limite .gami-barra__preenchimento { background: linear-gradient(90deg, var(--gami-bom), var(--gami-ouro)); }

/* Cofrinhos */
.gami-cofrinhos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 14px;
}
.gami-cofrinho { text-align: center; min-width: 0; }
.gami-cofrinho__pote {
  position: relative;
  width: 72px; height: 88px; margin: 0 auto 8px;
  border: 2px solid rgba(100, 150, 255, 0.4);
  border-top-width: 5px;
  border-radius: 14px 14px 26px 26px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
}
.gami-cofrinho__liquido {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(100, 150, 255, 0.75), rgba(100, 150, 255, 0.35));
  transition: height 1s cubic-bezier(.2,.8,.2,1);
}
.gami-cofrinho__liquido::before {
  content: ''; position: absolute; top: -5px; left: -10%; width: 120%; height: 10px;
  background: rgba(160, 190, 255, 0.55); border-radius: 50%;
  animation: gamiOnda 3s ease-in-out infinite;
}
@keyframes gamiOnda { 0%,100% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
.gami-cofrinho__pct {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 15px; font-weight: 900; color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.gami-cofrinho--cheio .gami-cofrinho__pote { border-color: var(--gami-bom); box-shadow: 0 0 16px rgba(52, 211, 153, 0.35); }
.gami-cofrinho--cheio .gami-cofrinho__liquido { background: linear-gradient(180deg, rgba(52, 211, 153, 0.85), rgba(52, 211, 153, 0.4)); }
.gami-cofrinho__nome {
  font-size: 12.5px; font-weight: 700; color: var(--text-primary);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gami-cofrinho__valor { font-size: 11px; color: var(--text-muted); }

/* Evolução (gráfico) */
.gami-legenda { display: flex; gap: 14px; font-size: 12px; color: var(--text-mid); }
.gami-legenda span, .gami-tooltip span { display: inline-flex; align-items: center; gap: 6px; }
.gami-legenda i, .gami-tooltip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.gami-grafico { position: relative; }
.gami-grafico svg { width: 100%; height: auto; display: block; overflow: visible; }
.gami-grafico__grade { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.gami-grafico__eixo { fill: var(--text-muted); font-size: 11px; font-family: inherit; }
.gami-grafico__mes { fill: var(--text-mid); font-size: 12px; font-weight: 600; font-family: inherit; }
.gami-grafico__mes--atual { fill: #fff; }
.gami-grafico__saldo { fill: var(--text-muted); font-size: 11px; font-family: inherit; }
.gami-grafico__alvo { fill: transparent; cursor: pointer; }
.gami-grafico__coluna.ativa .gami-grafico__alvo { fill: rgba(255, 255, 255, 0.04); }
.gami-grafico__coluna.ativa .gami-grafico__mes { fill: #fff; }
.gami-tooltip {
  position: absolute; top: 0; z-index: 5;
  display: flex; flex-direction: column; gap: 4px;
  min-width: 190px;
  background: #0f1024; border: 1px solid rgba(100, 150, 255, 0.35);
  border-radius: 8px; padding: 10px 12px;
  font-size: 12px; color: var(--text-mid);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.gami-tooltip strong { color: #fff; font-size: 12.5px; text-transform: capitalize; }
.gami-tooltip b { margin-left: auto; padding-left: 12px; color: var(--text-primary); }
.gami-tooltip b.pos { color: var(--gami-bom); }
.gami-tooltip b.neg { color: var(--gami-critico); }

/* Conquistas */
.gami-conquistas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.gami-conquista {
  text-align: center;
  padding: 14px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
}
.gami-conquista__icone { font-size: 28px; display: block; margin-bottom: 6px; filter: grayscale(1); opacity: 0.45; }
.gami-conquista__nome { font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.gami-conquista__desc { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.35; }
.gami-conquista--ok {
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.12), rgba(100, 150, 255, 0.06));
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.gami-conquista--ok .gami-conquista__icone { filter: none; opacity: 1; }
.gami-conquista--ok .gami-conquista__nome { color: #fff; }
.gami-conquista--ok .gami-conquista__desc { color: var(--text-mid); }

/* Comemorações */
.gami-xp-flutuante {
  position: fixed; z-index: 20000;
  transform: translate(-50%, 0);
  font-size: 18px; font-weight: 900; color: var(--gami-ouro);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  animation: gamiSobe 1.5s ease-out forwards;
}
@keyframes gamiSobe {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(0.8); }
  20%  { opacity: 1; transform: translate(-50%, -6px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(1); }
}
.gami-banner {
  position: fixed; left: 50%; top: 20px; z-index: 20001;
  transform: translate(-50%, -120%);
  background: linear-gradient(135deg, #1e2a55, #2b1f55);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fff; font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  transition: transform 0.35s cubic-bezier(.2,.8,.2,1);
  max-width: calc(100vw - 32px); text-align: center;
}
.gami-banner--visivel { transform: translate(-50%, 0); }
.gami-confete { position: fixed; inset: 0; pointer-events: none; z-index: 19999; overflow: hidden; }
.gami-confete i {
  position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px;
  animation-name: gamiCai; animation-timing-function: cubic-bezier(.25,.6,.4,1); animation-fill-mode: forwards;
}
@keyframes gamiCai {
  to { transform: translate(var(--desvio), 105vh) rotate(var(--giro)); opacity: 0.2; }
}

@media (prefers-reduced-motion: reduce) {
  .gami-card, .gami-sequencia__fogo, .gami-cofrinho__liquido::before { animation: none; }
  .gami-barra__preenchimento, .gami-anel__valor, .gami-cofrinho__liquido { transition: none; }
}

/* Responsivo */
@media (max-width: 1024px) {
  .gami-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gami-saude { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  .gami-hero, .gami-duplo { grid-template-columns: minmax(0, 1fr); }
  .gami-saude { grid-column: auto; }
  .gami-card { padding: 16px; }
  .gami-sequencia__valor { font-size: 26px; }
}
.gami-grafico svg { width: 100%; max-width: 100%; }
.gami-grafico__saldo.pos { fill: var(--gami-bom); }
.gami-grafico__saldo.neg { fill: var(--gami-critico); }
.gami-delta:not(.gami-delta--sobe):not(.gami-delta--desce) { color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   ORGANIZAÇÃO DO PAINEL DO CLIENTE
   Grupos: "Seu dinheiro" (fatos do período + evolução) e
   "Sua jornada" (missões, cofrinhos, conquistas).
   ═══════════════════════════════════════════════════════════════ */
.painel-grupo {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 -4px;
}
.painel-grupo span {
  font-size: 12.5px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-mid); white-space: nowrap;
}
.painel-grupo::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.card__hint { font-size: 12px; color: var(--text-muted); }

/* "Para onde foi o dinheiro": 4 grupos + taxa de poupança em faixa */
#cli-dashboard .bi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { #cli-dashboard .bi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.bi-item--destaque {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap;
  background: rgba(100, 150, 255, 0.09);
}
.bi-item--destaque .bi-label,
.bi-item--destaque .bi-value,
.bi-item--destaque .bi-detail { display: inline; margin: 0; }
.bi-item--destaque .bi-value { font-size: 22px; }
.bi-item--destaque .bi-detail { font-size: 12.5px; color: var(--text-mid); }
.bi-value--bom     { color: var(--gami-bom) !important; }
.bi-value--atencao { color: var(--gami-atencao) !important; }
.bi-value--ruim    { color: var(--gami-critico) !important; }

/* Missões e cofrinhos com a mesma altura, conteúdo no topo */
.gami-duplo { align-items: stretch; }

/* Impressão / PDF: mantém o tema escuro para que textos brancos
   (anel de saúde, conquistas, títulos) não sumam no papel. */
@media print {
  html, body, .card, .gami-card, .gami-hero, .bi-item, .resume-item, .gami-conquista {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .card, .gami-duplo, .gami-hero { break-inside: avoid; }
}

/* ═══════════════════════════════════════════════════════════════
   LOGIN — Google + botão de demonstração
   ═══════════════════════════════════════════════════════════════ */
.login-divisor {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 0 16px; color: var(--text-muted); font-size: 12.5px;
}
.login-divisor::before, .login-divisor::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.btn-google {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; border-radius: var(--radius);
  background: #fff; color: #1f1f1f; border: 1px solid #dadce0;
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition);
}
.btn-google:hover { background: #f5f7fb; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.btn-google:disabled { opacity: .7; cursor: wait; }

.login-demo {
  display: flex; align-items: center; gap: 12px;
  margin-top: 22px; padding: 14px 16px;
  border-radius: 12px; text-decoration: none;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.12), rgba(100, 150, 255, 0.12));
  border: 1px dashed rgba(52, 211, 153, 0.55);
  transition: transform var(--transition), border-color var(--transition);
}
.login-demo:hover { transform: translateY(-2px); border-style: solid; }
.login-demo__icone { font-size: 24px; }
.login-demo__texto { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.login-demo__texto strong { color: #fff; font-size: 14.5px; }
.login-demo__texto small { color: var(--text-mid); font-size: 12px; line-height: 1.35; }
.login-demo__seta { color: var(--gami-bom); font-size: 20px; font-weight: 800; }

/* ══════════════════════════════════════════════════════════════
   IMPORTAÇÃO — layout sem rolagem horizontal + busca de categoria
   (importacao-extrato.js: cada lançamento ocupa 2 linhas — dados em
   cima, categoria e origem embaixo; categoria é um campo de busca)
   ══════════════════════════════════════════════════════════════ */
.import-review__table-wrapper { overflow-x: hidden; }
.import-review__table { min-width: 0; display: block; }
.import-review__table thead { display: none; }
.import-review__table tbody { display: block; }

.import-review__table tbody tr {
  display: grid;
  grid-template-columns: 26px 140px minmax(0, 1fr) 115px 115px;
  grid-template-areas:
    "check data desc  valor tipo"
    ".     cat  cat   cat   origem";
  gap: 8px 10px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(100, 150, 255, 0.1);
  border-left: 3px solid transparent;
}
.import-review__table tbody tr:last-child { border-bottom: none; }
.import-review__table tbody td.imp-c { display: block; padding: 0; border: none; white-space: normal; min-width: 0; }
.imp-c-check  { grid-area: check; }
.imp-c-data   { grid-area: data; }
.imp-c-desc   { grid-area: desc; }
.imp-c-valor  { grid-area: valor; }
.imp-c-tipo   { grid-area: tipo; }
.imp-c-cat    { grid-area: cat; }
.imp-c-origem { grid-area: origem; text-align: right; line-height: 1.9; }

.import-review__table .imp-c input[type="text"],
.import-review__table .imp-c input[type="number"],
.import-review__table .imp-c input[type="date"],
.import-review__table .imp-c select { width: 100%; min-width: 0; }

.import-review__table tbody tr.import-row--sem-categoria { border-left-color: #fbbf24; background: rgba(251, 191, 36, 0.04); }
.import-review__table tbody tr.import-row--duplicada { opacity: 0.55; }
.import-review__table tbody tr.import-row--impedida {
  background: rgba(255, 77, 109, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 109, 0.5);
}
.import-row--impedida > td.imp-c { background: transparent !important; box-shadow: none; }

/* Campo de busca da categoria */
.cat-combo { position: relative; }
.cat-combo__input { padding-right: 34px !important; }
.cat-combo__limpar {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 24px; height: 24px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px;
}
.cat-combo__limpar:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }
.cat-combo__limpar:disabled { visibility: hidden; }

/* Painel de sugestões — fica no <body>, acima de modais (z-index alto) */
.cat-panel {
  position: fixed; z-index: 2147482000;
  overflow-y: auto; overscroll-behavior: contain;
  background: #14152a; border: 1px solid rgba(100, 150, 255, 0.35);
  border-radius: var(--radius); box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
  padding: 4px 0;
}
.cat-panel.hidden { display: none; }
.cat-panel__grupo {
  padding: 9px 12px 4px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
}
.cat-panel__item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--text-primary);
}
.cat-panel__item.ativo { background: rgba(100, 150, 255, 0.16); }
.cat-panel__item.selecionada .cat-panel__nome { color: var(--accent); font-weight: 700; }
.cat-panel__cod { font-family: monospace; font-size: 11px; color: var(--text-muted); flex-shrink: 0; }
.cat-panel__nome { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-panel__tag { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.cat-panel__vazio { padding: 12px; font-size: 12.5px; color: var(--text-mid); line-height: 1.5; }

@media (max-width: 640px) {
  .import-review__table tbody tr {
    grid-template-columns: 24px minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "check desc  desc"
      ".     data  valor"
      ".     tipo  origem"
      ".     cat   cat";
  }
  .imp-c-origem { text-align: left; }
  /* 16px evita o zoom automático do iPhone ao tocar no campo */
  .import-review__table .imp-c input, .import-review__table .imp-c select { font-size: 16px; }
}

/* ══════════════════════════════════════════════════════════════
   "QUANDO VOCÊ RECEBE?" — ciclo financeiro (app.js / ciclo.js)
   ══════════════════════════════════════════════════════════════ */
.modal__content.ciclo-modal { max-width: 480px; }
.ciclo-modal .modal__body { padding: 28px 24px 22px; }
.ciclo-modal__icone { font-size: 42px; text-align: center; line-height: 1; margin-bottom: 10px; }
.ciclo-modal__titulo { color: #fff; font-size: 21px; text-align: center; margin-bottom: 8px; }
.ciclo-modal__texto { color: var(--text-mid); font-size: 14px; line-height: 1.5; text-align: center; margin-bottom: 18px; }
.ciclo-opcoes { display: flex; flex-direction: column; gap: 10px; }
.ciclo-opcao {
  display: flex; gap: 12px; align-items: flex-start; margin: 0;
  padding: 12px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(100, 150, 255, 0.05); border: 1px solid var(--border);
  transition: border-color var(--transition), background var(--transition);
}
.ciclo-opcao:has(input:checked) { border-color: var(--accent); background: rgba(100, 150, 255, 0.12); }
.ciclo-opcao input[type="radio"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.ciclo-opcao__corpo { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ciclo-opcao__corpo strong { color: #fff; font-size: 14.5px; }
.ciclo-opcao__corpo > span { color: var(--text-muted); font-size: 12.5px; font-weight: 400; }
.ciclo-opcao__corpo select { margin-top: 8px; font-size: 16px; padding: 9px 35px 9px 12px; }
.ciclo-modal__previa {
  margin: 16px 0 4px; padding: 10px 12px; border-radius: 8px;
  background: rgba(52, 211, 153, 0.08); border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--text-primary); font-size: 13px; line-height: 1.5;
}
.ciclo-modal__acoes { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.ciclo-modal__acoes .btn { width: auto; min-width: 130px; padding: 11px 18px; font-size: 15px; }
.ciclo-modal__acoes .btn--primary:hover { transform: none; }
.perfil-ciclo__texto { color: var(--text-primary); font-size: 14px; }
@media (max-width: 480px) {
  .ciclo-modal__acoes { flex-direction: column-reverse; }
  .ciclo-modal__acoes .btn { width: 100%; }
}
