/* Parcelas: texto simples, barra removida */
.parcelas-info { display: flex; flex-direction: column; gap: 0; width: 100%; }
.parcelas-texto { font-weight: 500; text-align: center; }
.parcelas-barra { display: none; }
.parcelas-progresso { display: none; }
.parcelas-progresso-baixo { display: none; }
.parcelas-progresso-medio { display: none; }
.parcelas-progresso-alto { display: none; }

/* Estilos Gerais */
:root {
    --primary-color: #1E63F2; /* Azul Royal */
    --primary-dark: #184FCC; /* Azul Royal mais escuro */
    --secondary-color: #8A5CF6; /* detalhe roxo sutil */
    --success-color: #4ade80;
    --danger-color: #ef4444;
    --warning-color: #fbbf24;
    --info-color: #60a5fa;
    --light-gray: #F7F8FA; /* Cinza Neutro */
    --medium-gray: #E5E7EB;
    --dark-gray: #6B7280;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --body-bg: #f9fafb;
    --border-color: #e5e7eb;
    
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    --border-radius: 12px;
    --card-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    /* Ações outline (tema claro) */
    --action-outline-bg: rgba(17, 24, 39, 0.06);
    --action-outline-hover: rgba(17, 24, 39, 0.12);
    --action-outline-text: var(--gray-900);
    --action-outline-border: rgba(17, 24, 39, 0.18);
    /* Itens de menu (tema claro) */
    --menu-item-hover: rgba(0,0,0,0.05);
    --menu-item-color: var(--gray-900);
}

/* Tema escuro - variáveis globais */
:root.dark {
    --body-bg: #0b1220;
    --text-color: #e5e7eb;
    --text-light: rgba(229, 231, 235, 0.75);
    --border-color: #334155;
    /* Ações outline (tema escuro) */
    --action-outline-bg: rgba(255,255,255,0.08);
    --action-outline-hover: rgba(255,255,255,0.14);
    --action-outline-text: #e5e7eb;
    --action-outline-border: rgba(255,255,255,0.28);
    /* Itens de menu */
    --menu-item-hover: rgba(255,255,255,0.08);
    --menu-item-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--body-bg);
    margin: 0;
    padding: 0;
    font-size: clamp(14px, 1.2vw, 16px);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}
/* Imagens responsivas */
img { max-width: 100%; height: auto; }

/* Footer */
footer {
    background-color: var(--bg-white);
    padding: 20px 0;
    border-top: none;
    margin-top: 50px;
    box-shadow: none;
}
.dark footer { background-color: #0b1220; }

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

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
}

.footer-logo i {
    font-size: 18px;
}
.footer-logo-img { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; box-shadow: 0 0 10px rgba(30, 136, 229, 0.12); }

.footer-logo h3 {
    font-size: 18px;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
}

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.copyright {
    color: var(--text-light);
    font-size: 14px;
    text-align: center;
    padding-top: 15px;
    border-top: none;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.copyright .version {
    justify-self: center;
    font-weight: 600;
    color: var(--gray-700);
}

/* Footer no tema escuro (padrão da tela de login) */
footer.footer-dark {
  background: transparent;
  border-top: none;
  box-shadow: none;
  margin-top: 0;
}
footer.footer-dark .footer-logo { color: #1e88e5; }
footer.footer-dark .footer-logo i { color: #1e88e5; }
footer.footer-dark .footer-links a {
  color: rgba(255,255,255,0.75);
}
footer.footer-dark .footer-links a:hover {
  color: #1e88e5;
}
footer.footer-dark .copyright {
  color: rgba(255,255,255,0.6);
  border-top: none;
}

/* Seção de Boas-vindas */
#welcome-section {
    margin-bottom: 30px;
}

.welcome-container {
    background-color: var(--bg-white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--medium-gray);
}

.welcome-text h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.welcome-title {
    display: inline-block;
    background: linear-gradient(90deg, rgba(30,136,229,0.12), rgba(30,136,229,0.06));
    border: 1px solid var(--medium-gray);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: var(--card-shadow);
}

#welcomeUserName {
    color: #1e88e5;
    font-weight: 600;
}

.welcome-text p {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: 16px;
}

/* Chamada para ação na seção de boas-vindas */
.welcome-cta {
    margin-top: 12px;
    font-size: 0.95rem;
}
.welcome-cta a {
    color: var(--primary-color);
    text-decoration: underline;
}

.welcome-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature i {
    color: var(--success-color);
    font-size: 18px;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-size: 20px;
    margin-bottom: 5px;
    font-family: 'Outfit', var(--font-family);
}

.section-description {
    color: var(--text-light);
    font-size: 14px;
}

/* Header */
header {
    background-color: var(--bg-white);
    box-shadow: var(--card-shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 30px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.logo i {
    font-size: 24px;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    color: var(--primary-color);
    font-family: 'Outfit', var(--font-family);
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary-color);
    background-color: var(--secondary-color);
}

.header-buttons {
    display: flex;
    gap: 10px;
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.5rem, 1.2vw, 0.625rem) clamp(1rem, 2vw, 1.25rem);
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    gap: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    max-width: 100%;
}

.btn i {
    font-size: 16px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    transition: all 0.3s ease;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Botão secundário para ações informativas (Mensagem) */
.btn-secondary {
    background-color: #e5f6ff; /* azul muito claro para suavidade */
    color: var(--blue-600);
    border: 1px solid var(--gray-200);
}
.btn-secondary:hover {
    background-color: #d7efff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.btn-action {
    background-color: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background-color: var(--primary-dark);
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Tornar o botão "Não pagou" mais visível nas células de ações */
.acoes .btn-danger {
    background-color: #ff3b30; /* vermelho vivo para alta visibilidade */
    color: #ffffff;
    border: 1px solid #b91c1c;
    font-weight: 600;
}
.acoes .btn-danger:hover {
    background-color: #c81e1e; /* escurecer no hover para feedback */
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

/* Seções */
.section {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 25px;
    margin-bottom: 30px;
}

.section h2 {
    font-size: clamp(1.2rem, 2.4vw, 1.5rem);
    margin-bottom: 20px;
    color: var(--text-color);
    font-weight: 600;
    font-family: 'Outfit', var(--font-family);
}

.section h3 {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 500;
    font-family: 'Outfit', var(--font-family);
}

/* Dashboard */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--card-shadow);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card.clickable {
    cursor: pointer;
}

.card.clickable:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card h3 {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 10px;
}

.card-value {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 10px;
}

.card i {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 15px;
    opacity: 0.8;
}

/* Tabela */
.table-container {
    overflow-x: auto; /* permitir rolagem horizontal em desktop e mobile */
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 0 auto;
}

/* Espaçamento entre título e a grid/tabela */
.table-container > h3 {
    margin-bottom: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    table-layout: auto; /* permitir ajuste natural das colunas */
}
.dark table { background-color: #0f172a; }

/* Garantir rolagem horizontal quando houver muitas colunas/botões na tabela de Empréstimos Ativos */
#tabelaEmprestimos { min-width: 980px; }

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
    vertical-align: middle;
}
.dark th, .dark td { color: var(--text-color); border-bottom-color: var(--border-color); }
/* Cabeçalho mais escuro no tema escuro para melhorar contraste */
.dark th { background-color: #16223a; }
/* Alinhar números de forma estável */
th, td { font-variant-numeric: tabular-nums; }

/* Evitar que os títulos da tabela quebrem por letras
   Mantemos quebra para células de dados (td) apenas */
th {
    white-space: nowrap;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
}

td {
    white-space: normal;
    word-break: normal; /* evitar quebra no meio das palavras */
    overflow-wrap: anywhere; /* quebra quando necessário sem overflow */
}

/* =========================
   Pagamentos (Desktop) – melhorar Status/Observação
   Evita quebra letra a letra e permite ajuste natural da largura
========================= */
#tabelaPagamentos { table-layout: auto; }
#tabelaPagamentos th:nth-child(5),
#tabelaPagamentos td:nth-child(5) {
  white-space: normal;          /* permite quebra em espaços */
  word-break: normal;           /* evita quebra no meio das palavras */
  overflow-wrap: anywhere;      /* quebra quando necessário sem overflow */
  min-width: 220px;             /* garante respiro para badge + texto */
}
#tabelaPagamentos td:nth-child(5) .cell-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;              /* observação pode ir para a próxima linha */
}
#tabelaPagamentos td:nth-child(5) .status-badge {
  flex-shrink: 0;               /* mantém o badge íntegro sem esmagar */
}
/* Evitar que datas e valores quebrem em várias linhas nas tabelas principais */
#tabelaEmprestimos td,
#tabelaTodosEmprestimos td,
#tabelaPendentes td {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    word-break: normal;
}
/* Tabela de Empréstimos: reservar espaço para Status e Ações */
#tabelaEmprestimos th:nth-child(7), #tabelaEmprestimos td:nth-child(7) { width: 140px; }
#tabelaEmprestimos th:nth-child(9), #tabelaEmprestimos td:nth-child(9) { width: 240px; }
#tabelaEmprestimos td.acoes { min-width: 220px; }

/* Tabela de Todos os Empréstimos (página Empréstimos): reservar espaço para Status e Ações */
#tabelaTodosEmprestimos th:nth-child(7), #tabelaTodosEmprestimos td:nth-child(7) { width: 140px; }
#tabelaTodosEmprestimos th:nth-child(8), #tabelaTodosEmprestimos td:nth-child(8) { width: 240px; }
#tabelaTodosEmprestimos td.acoes { min-width: 220px; display: flex; align-items: center; gap: 8px; }

th {
    background-color: #f8fafc;
    font-weight: 500;
}

#clientesPendentes {
    margin-top: 30px;
    margin-bottom: 30px;
}

#tabelaPendentes tr:hover {
    background-color: var(--row-hover);
}

/* Linhas alternadas para tabelas pendentes (sensível ao tema) */
#tabelaPendentes tbody tr:nth-child(even) {
    background-color: var(--row-alt);
}

tbody tr:hover {
    background-color: var(--row-hover);
}
/* ===== Overrides Tema Escuro ===== */
.dark header { background-color: #0b1220; border-bottom: 1px solid var(--border-color); box-shadow: var(--shadow-soft); }
.dark .section, .dark .card { background-color: #0f172a; border-color: var(--border-color); box-shadow: var(--shadow-soft); }
.dark .section-header h2, .dark .section h2, .dark .section h3, .dark .card h3 { color: var(--text-color); }
.dark .section-description, .dark .welcome-text p { color: var(--text-light); }
.dark .dashboard-cards .card { box-shadow: var(--shadow-soft); }
.dark .welcome-container { background-color: #0f172a; border-color: var(--border-color); }
.dark .welcome-title { border-color: var(--border-color); box-shadow: var(--shadow-soft); background: linear-gradient(90deg, rgba(30,136,229,0.08), rgba(30,136,229,0.04)); }
.dark tbody tr:hover { background-color: var(--row-hover); }
.dark #tabelaPendentes tbody tr:nth-child(even) { background-color: var(--row-alt); }
/* Botões no tema escuro: evitar fundo branco ao passar o mouse */
.dark .btn-outline { background-color: transparent !important; color: var(--primary-color); border-color: rgba(30, 99, 242, 0.45); }
.dark .btn-outline:hover { background-color: rgba(30, 99, 242, 0.18) !important; }
.dark .btn.action-btn.outline { background-color: transparent; color: var(--menu-item-color); }
.dark .btn.action-btn.outline:hover { background-color: rgba(255,255,255,0.12); color: var(--menu-item-color); }
/* Padronização botão Mensagem (WhatsApp) */
.btn.btn-secondary { height: 40px; padding: 0 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px; min-width: 120px; justify-content: center; }
.btn.btn-secondary i.fab.fa-whatsapp { color: #25D366; font-size: 18px; }
.dark .btn.btn-secondary { background-color: rgba(30, 99, 242, 0.12) !important; color: var(--blue-500); border-color: rgba(30, 99, 242, 0.35); }
.dark .btn.btn-secondary:hover { background-color: rgba(30, 99, 242, 0.18) !important; }

.status-ativo {
    color: var(--success-color);
    font-weight: 500;
}

.status-quitado {
    color: var(--dark-gray);
}

.acoes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    row-gap: 8px;
    align-items: center; /* garantir alinhamento vertical central */
}

.btn-acao {
    padding: clamp(0.4rem, 1vw, 0.5rem) clamp(0.6rem, 1.2vw, 0.75rem);
    font-size: clamp(0.75rem, 1.6vw, 0.85rem);
    border-radius: var(--border-radius);
    max-width: 100%;
}

/* Botão pequeno para ações em tabela */
.btn-sm {
    padding: 0.5rem 1rem; /* px-4 py-2 equivalente */
    font-size: clamp(0.82rem, 1.5vw, 0.92rem);
    border-radius: 12px; /* rounded-lg */
    min-height: 40px;
    min-width: 100px; /* min-w-[100px] */
    display: inline-flex;
    align-items: center; /* items-center */
    justify-content: center; /* justify-center */
    gap: 8px; /* espaço para ícone + texto */
    font-weight: 600; /* font-semibold */
    transition: all 0.2s ease; /* transition-all duration-200 */
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Botão "Pagar" uniforme com efeito neon azul e centralização */
.btn-pay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* gap-2 equivalente */
    width: auto;
    min-width: 110px;
    padding: 0.5rem 1rem; /* px-4 py-2 */
    color: #fff;
    background: var(--primary-color);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px; /* rounded-lg */
    font-weight: 600; /* font-semibold */
    transition: all 0.2s ease; /* transition-all duration-200 */
    box-shadow: 0 0 12px rgba(30, 136, 229, 0.25), 0 6px 12px rgba(17, 24, 39, 0.08);
    writing-mode: horizontal-tb;
    white-space: nowrap;
}
.btn-pay:hover {
    background: var(--primary-dark);
    opacity: 0.9; /* hover:opacity-90 */
    box-shadow: 0 0 14px rgba(30, 136, 229, 0.38), 0 8px 16px rgba(17, 24, 39, 0.12);
}
.btn-pay i { font-size: 16px; }
.btn-pay i + .btn-text { margin-left: 4px; }

/* Garantir alinhamento vertical uniforme nas linhas da tabela */
table tr { vertical-align: middle; }
td, th { vertical-align: middle; }

/* Ajuste de célula de ações para centralizar conteúdo */
td.acoes {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px; /* gap-2 / space-x-2 */
    flex-wrap: wrap; /* permitir quebra de linha entre botões */
    overflow: visible; /* evitar corte e barra de rolagem interna */
}

/* Wrapper interno para ações: melhora rolagem e evita corte de conteúdo */
.acoes-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  overflow-x: visible;
  overflow-y: hidden;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* Scrollbar estilizada para wrapper interno */
.acoes-wrap::-webkit-scrollbar { height: 8px; }
.acoes-wrap::-webkit-scrollbar-track { background: transparent; }
.acoes-wrap::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.3); border-radius: 8px; display: none; }

/* Ações com rolagem horizontal mais previsível e visual elegante */
#tabelaEmprestimos td.acoes,
#tabelaPendentes td.acoes,
#tabelaTodosEmprestimos td.acoes {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap; /* permitir quebra em várias linhas conforme necessário */
  overflow: visible; /* sem barras internas, conteúdo ajusta-se naturalmente */
}

/* Assegurar que botões nas células de ações não encolham e se ajustem ao conteúdo */
td.acoes .btn,
.acoes-wrap .btn,
td.acoes .btn-sm,
td.acoes .btn-pay {
  flex: 0 0 auto;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Texto dentro dos botões sempre em uma linha, sem quebra */
.btn .btn-text { white-space: nowrap; }

/* WebKit scrollbar dentro das células de ações */
td.acoes::-webkit-scrollbar { height: 8px; }
td.acoes::-webkit-scrollbar-track { background: transparent; }
td.acoes::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.3); border-radius: 8px; }

/* Manter tom azul e tipografia consistente */
.btn.btn-primary { background: var(--primary-color); color: #fff; }
.btn.btn-primary:hover { background: var(--primary-dark); }
/* Base sizing for action buttons */
.btn.btn-primary,
.btn.btn-danger,
.btn.btn-outline,
.btn.btn-secondary {
    padding: 0.5rem 1rem; /* px-4 py-2 */
    min-width: 100px; /* min-w-[100px] */
    border-radius: 12px; /* rounded-lg */
    font-weight: 600; /* font-semibold */
    display: inline-flex;
    align-items: center; /* items-center */
    justify-content: center; /* justify-center */
    gap: 8px; /* space for icon+text */
    transition: all 0.2s ease; /* transition-all duration-200 */
}

/* Formulários */
.form-section {
    max-width: 840px;
    margin: 0 auto 30px;
    width: 100%;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group.small {
    flex: 0 0 120px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Resultado do Cálculo */
.resultado-calculo {
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
}

.resultado-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.resultado-item {
    display: flex;
    flex-direction: column;
}

.resultado-item span {
    font-size: 0.9rem;
    color: var(--dark-gray);
}

.resultado-item strong {
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Estilos para mensagens do sistema */
#mensagem-sistema {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    font-weight: 500;
    display: none;
    animation: fadeInOut 0.3s ease-in-out;
}

.mensagem-sucesso {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.mensagem-erro {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.mensagem-aviso {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Modal de Parcelas – transição suave de entrada */
@keyframes modalFadeIn {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    position: relative;
}
.dark .modal-content { background-color: #0f172a; color: var(--text-color); border: 1px solid var(--border-color); }

/* Modal de Pagamento – visual moderno e responsivo */
#modalPagamento .modal-content {
  max-width: 560px;
  padding: 28px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}
#modalPagamento #tituloModalPagamento { text-align: center; margin: 0 0 16px 0; }
#modalPagamento .form-info {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 6px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.dark #modalPagamento .form-info { background: var(--bg-white); }
#modalPagamento .form-info p { margin: 0; display: flex; justify-content: space-between; gap: 8px; }

/* Grupo de Tipo de Pagamento com estilos de pílula */
#modalPagamento .payment-type-group { flex-wrap: wrap; gap: 10px; }
#modalPagamento .payment-type-group .radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08); /* verde suave padrão */
  color: var(--success-color);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
#modalPagamento .payment-type-group .radio-inline i { color: currentColor; }
#modalPagamento .payment-type-group .radio-inline:hover { border-color: var(--success-color); box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.20); }
#modalPagamento .payment-type-group input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
/* realce quando selecionado (suporte moderno) */
#modalPagamento .payment-type-group .radio-inline:has(input:checked) {
  border-color: var(--success-color);
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.24);
  background: rgba(74, 222, 128, 0.18);
}

/* Inputs pretos com alta legibilidade */
#modalPagamento input,
#modalPagamento select,
#modalPagamento textarea {
  background: var(--bg-white);
  color: var(--text-color);
  border-color: var(--border-color);
}
.dark #modalPagamento input,
.dark #modalPagamento select,
.dark #modalPagamento textarea {
  background: var(--bg-white);
  color: var(--text-color);
  border-color: var(--border-color);
}
#modalPagamento input::placeholder,
#modalPagamento textarea::placeholder { color: var(--gray-700); }
#modalPagamento input:focus,
#modalPagamento select:focus,
#modalPagamento textarea:focus {
  border-color: var(--success-color);
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.20);
}

/* Alinhamento e espaçamentos consistentes */
#modalPagamento .form-row { gap: 14px; margin-bottom: 12px; }
#modalPagamento .form-group label { margin-bottom: 6px; }
#modalPagamento .form-group label { color: #64748b; font-weight: 600; }
#modalPagamento .form-buttons { margin-top: 16px; }
#modalPagamento .btn { min-width: 140px; }

/* Responsividade específica do modal */
@media (max-width: 480px) {
  #modalPagamento .modal-content { max-width: 94%; padding: 22px; }
  #modalPagamento .btn { width: 100%; }
  #modalPagamento .payment-type-group { gap: 8px; }
}

/* Centraliza o título do modal de pagamento */
#tituloModalPagamento {
    text-align: center;
    margin: 0 0 16px 0;
}

/* Utilitários suaves para texto cinza */
.text-gray-600 { color: #64748b; }
.rounded-2xl { border-radius: 16px; }
.shadow-lg { box-shadow: 0 10px 30px rgba(17,24,39,0.16); }

/* Centralização e alinhamento do conteúdo do modal */
#modalPagamento .modal-content {
    display: flex;
    flex-direction: column;
    align-items: stretch; /* ocupar toda largura */
    gap: 16px; /* space-y-4 */
    padding: 24px; /* p-6 */
    border-radius: 16px; /* rounded-2xl */
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.16); /* shadow-lg */
}

#modalPagamento form {
    width: 100%;
}

#modalPagamento .form-row,
#modalPagamento .form-buttons {
    display: flex;
}

#modalPagamento .form-info {
    display: flex; /* flex */
    flex-wrap: wrap; /* flex-wrap */
    align-items: baseline;
    justify-content: space-between; /* justify-between */
    gap: 8px 16px; /* gap-2 gap-x-4 */
    text-align: left;
    padding: 12px 14px;
    border: 1px solid rgba(2, 6, 23, 0.08);
    border-radius: 12px;
}

#modalPagamento .form-info p {
    display: flex;
    align-items: baseline;
    gap: 8px; /* gap-2 */
    margin: 0;
    flex: 1 1 220px; /* três colunas com wrap */
}

#modalPagamento .form-info strong {
    font-weight: 700; /* negrito para rótulos */
    color: #64748b; /* text-gray-600 */
}

#modalPagamento .form-info span {
    font-weight: 600; /* destaque para valores */
    color: #0f172a; /* texto principal (slate-900) */
}

#modalPagamento .form-info .label { color: #64748b; font-weight: 700; }
#modalPagamento .form-info .value { color: #0f172a; font-weight: 600; }

#modalPagamento .payment-type-group {
    justify-content: center;
    flex-wrap: wrap; /* flex-wrap */
    gap: 10px; /* gap-2 */
}

#modalPagamento .payment-type-group .radio-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center; /* justify-center */
    gap: 8px; /* gap-2 */
    padding: 10px 16px; /* px-4 py-2 */
    min-width: 160px; /* mesmo tamanho entre opções */
    height: 44px;
    border-radius: 12px; /* rounded-lg */
    border: 2px solid rgba(74, 222, 128, 0.45); /* verde suave */
    background: rgba(74, 222, 128, 0.10);
    color: #16a34a; /* verde */
    font-weight: 600; /* font-semibold */
    transition: all 0.2s ease;
    cursor: pointer;
}

#modalPagamento .payment-type-group .radio-inline:hover {
    background: rgba(74, 222, 128, 0.16);
}

#modalPagamento .payment-type-group .radio-inline input {
    margin-right: 6px;
}

#modalPagamento .form-buttons {
    gap: 10px; /* space-x-2 */
    justify-content: space-between;
}

@media (max-width: 480px) {
  #modalPagamento .modal-content { max-width: 94%; padding: 22px; }
  #modalPagamento .btn { width: 100%; }
  #modalPagamento .payment-type-group { gap: 8px; justify-content: center; }
  #modalPagamento .form-info p { flex: 1 1 100%; }
  #modalPagamento .form-buttons { flex-direction: column; gap: 8px; }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8; /* slate-400 para contraste no fundo escuro */
}

.close-modal:hover {
    color: #e2e8f0; /* slate-200 no hover */
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    background-color: var(--bg-white);
    box-shadow: none;
    margin-top: 0; /* evitar gap entre conteúdo e rodapé */
    border-top: none;
}
.dark footer { background-color: #0b1220; }

footer p {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* Responsividade */
@media (max-width: 1200px) {
    .container { max-width: 1000px; }
    .section { padding: 22px; }
}

@media (max-width: 992px) {
    .container { max-width: 860px; padding: 0 16px; }
    .dashboard-cards { gap: 16px; }
    .section { padding: 20px; }
    .nav-text { font-size: 13px; }
    .nav-actions { justify-content: flex-start; }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .header-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .dashboard-cards { grid-template-columns: 1fr; }
    
    .form-group {
        min-width: 100%;
    }
    
    /* Mobile refinements */
    .section { padding: 18px; }
    .section h2 { font-size: 1.15rem; margin-bottom: 14px; }
    .section h3 { font-size: 1rem; margin-bottom: 12px; }
    
    .form-row { gap: 14px; margin-bottom: 12px; }
    .form-group { min-width: 100%; }
    label { font-size: 0.9rem; }
    input, select, textarea { padding: 10px 12px; font-size: 15px; }
    
    .form-buttons { flex-direction: column; width: 100%; gap: 10px; }
    .form-buttons button { width: 100%; }
    
    .btn, .btn-action, .btn-primary, .btn-outline, .btn-success, .btn-danger { width: 100%; }
    .btn { padding: 0.6rem 1rem; font-size: 0.95rem; }
}

@media (max-width: 480px) {
    .section { padding: 14px; }
    .section h2 { font-size: 1.1rem; }
    .section h3 { font-size: 0.95rem; }
    th, td { padding: 8px 10px; font-size: 0.85rem; }
    .card-value { font-size: 1.45rem; }
    .btn { width: 100%; }
    .form-buttons { flex-direction: column; gap: 10px; }
    .form-row { gap: 12px; margin-bottom: 10px; }
}

/* =========================
   Mobile Dashboard Optimizations
   ========================= */
@media (max-width: 768px) {
    /* Melhora geral de tabelas em mobile */
    #tabelaEmprestimos,
    #tabelaPendentes {
        table-layout: auto;
    }
    /* Aplicar mesmo comportamento na página de Empréstimos */
    #tabelaTodosEmprestimos { table-layout: auto; }
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    /* Evita cabeçalhos quebrando letra por letra */
    #tabelaEmprestimos th,
    #tabelaPendentes th {
        white-space: nowrap;
        word-break: keep-all;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    #tabelaTodosEmprestimos th {
        white-space: nowrap;
        word-break: keep-all;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    /* Dados com quebra suave quando necessário */
    #tabelaEmprestimos td,
    #tabelaPendentes td {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    #tabelaTodosEmprestimos td {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }

    /* Oculta colunas menos críticas no mobile - Empréstimos */
    /* 1: Cliente | 2: Data | 3: Valor | 4: Juros | 5: Parcelas | 6: Valor Parcela | 7: Status | 8: Data Prevista | 9: Ações */
    #tabelaEmprestimos th:nth-child(2), #tabelaEmprestimos td:nth-child(2), /* Data */
    #tabelaEmprestimos th:nth-child(3), #tabelaEmprestimos td:nth-child(3), /* Valor Total */
    #tabelaEmprestimos th:nth-child(4), #tabelaEmprestimos td:nth-child(4), /* Juros */
    #tabelaEmprestimos th:nth-child(8), #tabelaEmprestimos td:nth-child(8)  /* Data Pagamento Prevista */
    { display: none; }

    /* Mantém visível: Cliente, Parcelas, Valor Parcela, Status, Ações */

    /* Oculta colunas menos críticas no mobile - Todos Emprestimos (página) */
    /* 1: Cliente | 2: Valor | 3: Juros | 4: Parcelas | 5: Valor Parcela | 6: Data | 7: Status | 8: Ações */
    #tabelaTodosEmprestimos th:nth-child(2), #tabelaTodosEmprestimos td:nth-child(2), /* Valor */
    #tabelaTodosEmprestimos th:nth-child(3), #tabelaTodosEmprestimos td:nth-child(3), /* Juros */
    #tabelaTodosEmprestimos th:nth-child(6), #tabelaTodosEmprestimos td:nth-child(6)  /* Data */
    { display: none; }

    /* Oculta colunas menos críticas no mobile - Pendentes, mantendo Ações visível */
    /* 1: Cliente | 2: Valor Total | 3: Valor Pago | 4: Valor Pendente | 5: Parcelas Pendentes | 6: Ações */
    /* Para o resumo dos empréstimos ativos, manter TODAS as colunas visíveis no mobile */
    #tabelaPendentes th, #tabelaPendentes td { display: table-cell; }

    /* Espaçamento extra para o título Resumo dos Empréstimos Ativos */
    .resumo-ativos-title {
        margin-bottom: 16px; /* aumenta espaçamento abaixo do título */
    }

    /* Botões de ação no contexto da tabela não devem ocupar 100% da largura */
    .acoes .btn,
    .acoes .btn-pay,
    .acoes .btn-sm,
    td.acoes .btn {
        width: auto;
        min-width: 96px; /* garante toque confortável */
        display: inline-flex;
    }

    /* Evitar cortes no status da página de Empréstimos */
    #tabelaTodosEmprestimos td:nth-child(7) { white-space: nowrap; overflow: visible; }

    /* Pagamentos (React) – esconder colunas menos críticas em telas pequenas */
    /* 1: Cliente | 2: Valor Pago | 3: Data | 4: Valor Pendente | 5: Status/Obs | 6: Ações */
    #tabelaPagamentos th:nth-child(4), #tabelaPagamentos td:nth-child(4) { display: none; } /* Valor Pendente pode ser inferido no detalhe */
    /* Preservar Status/Obs e Ações; permitir elipse e overflow visível para badge */
    #tabelaPagamentos td:nth-child(5) { white-space: nowrap; overflow: visible; }
    #tabelaPagamentos td:nth-child(6) { white-space: nowrap; }
    #tabelaPagamentos th, #tabelaPagamentos td { text-overflow: ellipsis; overflow: hidden; }

    /* Permitir rolagem horizontal nas ações para visualizar todos os botões */
    #tabelaEmprestimos td.acoes,
    #tabelaPendentes td.acoes,
    #tabelaTodosEmprestimos td.acoes {
        overflow: visible; /* sem rolagem interna */
        -webkit-overflow-scrolling: touch;
        flex-wrap: wrap; /* permitir quebra em múltiplas linhas */
    }
}

@media (max-width: 480px) {
    /* Refinos visuais adicionais em telas muito pequenas */
    .card { padding: 16px; }
    .card h3 { font-size: 0.95rem; }
    .card-value { font-size: 1.35rem; }
    #tabelaEmprestimos th, #tabelaEmprestimos td,
    #tabelaPendentes th, #tabelaPendentes td { font-size: 0.82rem; padding: 8px; }
    .table-container { margin: 0 -8px; padding: 0 8px; }
    .btn-pay { min-width: 96px; padding: 8px 10px; }
    /* Pagamentos (React) – reduzir padding/ fonte em mobile estreito */
    #tabelaPagamentos th, #tabelaPagamentos td { font-size: 0.82rem; padding: 8px; }
    /* Esconder Data em telas muito pequenas para evitar quebra extrema */
    #tabelaPagamentos th:nth-child(3), #tabelaPagamentos td:nth-child(3) { display: none; }
}
/* ===== Topbar (FinanciaMais) ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --bg-white: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --blue-600: #1565c0;
  --blue-500: #1e88e5;
  --blue-100: #e3f2fd;
  --gray-900: #0f172a;
  --gray-700: #334155;
  --gray-500: #64748b;
  --gray-200: #e5e7eb;
  --shadow-soft: 0 10px 24px rgba(30, 99, 242, 0.10), 0 2px 8px rgba(17, 24, 39, 0.06);
  --radius: 12px;
  /* Linhas de tabela padrão (tema claro) */
  --row-hover: rgba(0,0,0,0.04);
  --row-alt: rgba(0,0,0,0.02);
}

/* Tema escuro (Global) */
:root.dark {
  --bg-white: #0b1220;
  --bg-glass: rgba(12, 18, 30, 0.85);
  --gray-900: #e5e7eb;
  --gray-700: #cbd5e1;
  --gray-500: #94a3b8;
  --gray-200: #334155;
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.5);
  /* Linhas de tabela no tema escuro */
  --row-hover: rgba(255,255,255,0.04);
  --row-alt: rgba(255,255,255,0.02);
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--gray-900);
}

#main-header.hidden { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: saturate(180%) blur(8px);
  /* Light mode: clean, light background */
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
}
/* Dark mode: animated gradient background */
.dark .topbar {
  background: linear-gradient(90deg, #0f172a, #1e293b, #0f172a);
  background-size: 300% 300%;
  animation: gradientMove 10s ease infinite;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* nav | brand | actions */
  grid-template-areas: "nav brand actions";
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 0 20px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; justify-self: center; grid-area: brand; text-align: center; }
.brand-logo-img { width: 28px; height: 28px; object-fit: contain; border-radius: 6px; box-shadow: 0 0 12px rgba(30, 136, 229, 0.15); }
.brand-icon { font-size: 22px; }
.brand-text { font-size: 18px; font-weight: 600; color: var(--gray-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Pro: aplicar Outfit na marca */
.brand-text { font-family: 'Outfit', var(--font-family); }

.hamburger {
  grid-area: actions;
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}
.hamburger:focus { outline: 2px solid var(--blue-100); }
.hamburger-box { display: inline-block; width: 28px; height: 18px; position: relative; }
.hamburger-inner, .hamburger-inner::before, .hamburger-inner::after {
  width: 28px; height: 2px; background: var(--gray-700); border-radius: 2px; position: absolute; left: 0; transition: transform 200ms ease, opacity 200ms ease; content: '';
}
.hamburger-inner { top: 8px; }
.hamburger-inner::before { top: -6px; }
.hamburger-inner::after { top: 6px; }
/* Estado aberto: animação para X */
.hamburger.open .hamburger-inner { transform: rotate(45deg); }
.hamburger.open .hamburger-inner::before { transform: translateY(6px) rotate(90deg); }
.hamburger.open .hamburger-inner::after { opacity: 0; }

.nav { display: flex; align-items: center; justify-content: flex-start; gap: 12px; grid-area: nav; }
.nav-list { list-style: none; display: inline-flex; align-items: center; gap: 10px; margin: 0; padding: 0; }
.nav-item { }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-700);
  text-decoration: none;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  transition: background 180ms ease, color 180ms ease, transform 100ms ease, box-shadow 180ms ease;
  background: var(--bg-white);
  border: 1px solid var(--gray-200);
  position: relative;
}
/* Dark theme styling for nav links */
.dark .nav-link {
  color: #e5e7eb;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.nav-link:hover { background: linear-gradient(90deg, rgba(37,99,235,0.2), rgba(59,130,246,0.2)); color: #fff; box-shadow: 0 0 12px rgba(59,130,246,0.25); }
.nav-link:focus-visible { outline: 2px solid var(--blue-100); outline-offset: 2px; }
.nav-link:active { transform: translateY(1px); }
.nav-icon { font-size: 18px; opacity: 0.9; }
.nav-text { font-size: 14px; font-weight: 500; }

.nav-link.active {
  background: linear-gradient(90deg, rgba(37,99,235,0.25), rgba(59,130,246,0.25));
  color: #fff;
  box-shadow: 0 4px 12px rgba(59,130,246,0.28);
}
.nav-link.active .nav-icon { opacity: 1; }

/* Underline animado no item ativo */
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 3px;
  height: 2px;
  background: linear-gradient(90deg, #2563eb, #3b82f6);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms ease;
  opacity: 0.9;
}
.nav-link.active::after { transform: scaleX(1); }

.nav-actions { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; position: relative; z-index: 10; flex-wrap: wrap; overflow: visible; }
.user-menu { display: inline-flex; align-items: center; gap: 10px; }
.user-name { color: var(--gray-700); font-weight: 500; }

/* Avatar (iniciais "Braw") */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 12px rgba(59,130,246,0.35);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
  cursor: pointer;
}
.avatar-menu {
  position: absolute;
  margin-top: 10px;
  right: 0;
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  display: none;
  z-index: 20;
}
.avatar-menu.open { display: block; }
.avatar-menu a { display: flex; align-items: center; gap: 8px; color: var(--menu-item-color); text-decoration: none; padding: 8px 10px; border-radius: 8px; transition: background 160ms ease, color 160ms ease; }
.avatar-menu a:hover { background: var(--menu-item-hover); color: var(--menu-item-color); }
.user-menu.open .avatar-menu { display: block; }

/* Ícones vibrantes por seção */
#btnDashboard .nav-icon { color: #3b82f6; }
#btnListaClientes .nav-icon { color: #8b5cf6; }
#btnListaEmprestimos .nav-icon { color: #22c55e; }
#btnListaPagamentos .nav-icon { color: #f59e0b; }
#btnFaturamento .nav-icon { color: #ec4899; }
#btnRelatorios .nav-icon { color: #32b5f0; }
#btnConsultas .nav-icon { color: #fbbf24; }

/* Notificação em Consultas */
.notif-dot { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; right: 8px; top: 8px; box-shadow: 0 0 0 2px rgba(0,0,0,0.25); }


.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-white);
  color: var(--gray-700);
  cursor: pointer;
  transition: box-shadow 180ms ease, transform 100ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
  max-width: 100%;
}

/* Botão ícone-only: mais compacto */
.btn.icon-only { width: 40px; min-width: 40px; padding: 0; justify-content: center; }
#btnTheme { width: 36px; height: 36px; border-radius: 50%; padding: 0; }
#btnTheme:hover { box-shadow: 0 8px 18px rgba(17,24,39,0.12); }
html, body, .topbar, .nav, .nav-link, .btn, .section, table, th, td { transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease; }

/* PRO Theme Enhancements */
/* Animated page background gradient for richer dark tech aesthetic */
/* Apply animated gradient only in dark mode */
.dark body {
  background-image: linear-gradient(180deg, #0a0f1c, #111827, #1e293b);
  background-size: 400% 400%;
  animation: gradientShift 18s ease infinite;
}

/* Navigation hover/active refined glow and motion */
.nav-link:hover {
  border-color: rgba(59,130,246,0.25);
  box-shadow: 0 6px 18px rgba(59,130,246,0.20);
  transform: translateY(-1px) scale(1.01);
}
.nav-link.active {
  background: linear-gradient(90deg, #2563eb, #1e3a8a);
  border-color: rgba(59,130,246,0.38);
  box-shadow: 0 8px 24px rgba(37,99,235,0.25);
}

/* Consistent icon box sizing */
.nav-icon { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; }
.nav-icon i { font-size: 18px; }

/* Actions title styling */
.actions-title {
  margin-top: 16px;
  margin-bottom: 8px;
  color: #93c5fd;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(59,130,246,0.25);
  padding-bottom: 6px;
  font-family: 'Outfit', var(--font-family);
}

/* Elevation and glow for primary/outline actions */
.btn.action-btn.primary { box-shadow: 0 8px 24px rgba(59,130,246,0.35); }
.btn.action-btn.primary:hover { box-shadow: 0 10px 28px rgba(59,130,246,0.35); }
.btn.action-btn.outline { background: rgba(255,255,255,0.08); }
.btn.action-btn.outline:hover { background: rgba(255,255,255,0.14); }

/* Mobile glassy sidebar behavior (dark only) */
@media (max-width: 768px) {
  .dark .sidebar, .dark .nav { background: rgba(17,24,39,0.45); backdrop-filter: blur(20px); }
}

@keyframes gradientShift {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 100%; }
  100% { background-position: 0% 0%; }
}

.btn.action-btn { flex: 0 1 auto; }
.nav-actions .btn { flex: 0 0 auto; }

/* Evitar overflow horizontal geral (página) */
html, body { overflow-x: hidden; }
.btn:hover { box-shadow: 0 6px 18px rgba(17, 24, 39, 0.08); border-color: rgba(30, 136, 229, 0.25); }
.btn:focus-visible { outline: 2px solid var(--blue-100); outline-offset: 2px; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn .btn-icon { font-size: 18px; }

.btn.action-btn.primary {
  background: linear-gradient(90deg, #1e40af, #3b82f6);
  color: #fff;
  border-color: rgba(59,130,246,0.6);
  box-shadow: 0 6px 16px rgba(59,130,246,0.35);
  transition: box-shadow 160ms ease, transform 140ms ease;
}
.btn.action-btn.primary:hover { box-shadow: 0 8px 18px rgba(59,130,246,0.40); transform: translateY(-1px); }

.btn.action-btn.outline {
  background: var(--action-outline-bg);
  color: var(--action-outline-text);
  border-color: var(--action-outline-border);
  transition: box-shadow 160ms ease, transform 140ms ease, background 140ms ease;
}
.btn.action-btn.outline:hover { background: var(--action-outline-hover); color: var(--action-outline-text); box-shadow: 0 6px 16px rgba(59,130,246,0.20); }

/* Responsive */
/* Tablet compacto: manter menu horizontal com itens menores */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav-link { height: 36px; padding: 0 12px; }
  .nav-text { font-size: 13px; }
  .btn { height: 36px; padding: 0 12px; }
  .brand-text { font-size: 16px; }
}
@media (max-width: 1024px) {
  .topbar-inner { grid-template-columns: auto 1fr auto; grid-template-areas: "actions brand ."; }
  .nav-actions { justify-content: flex-start; flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .topbar-inner { grid-template-columns: auto 1fr auto; grid-template-areas: "actions brand ."; align-items: center; gap: 12px; }
  .brand { min-width: 0; justify-self: center; gap: 8px; }
  .brand-logo-img { width: 26px; height: 26px; }
  .hamburger { justify-self: start; }
  .nav {
    position: static;
    width: 100%;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    padding: 12px 16px;
    display: none;
    flex-direction: column;
    gap: 16px;
  }
  .nav.open { display: flex; }
  .nav-list { width: 100%; display: flex; flex-direction: column; gap: 6px; }
  .nav-link { padding: 10px 12px; }
  .nav-actions { width: 100%; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 10; }
  .hamburger { display: inline-flex; }
  /* Ações inline no mobile: empilhar verticalmente e ocupar largura */
  .actions-inline { display: flex; flex-direction: column; gap: 8px; align-items: stretch; width: 100%; }
  .actions-inline .btn { width: 100%; }
  /* Garantir ordem: Novo Cliente acima de Novo Empréstimo */
  #btnNovoCliente { order: 1; }
  #btnNovoEmprestimo { order: 2; }
  .actions-toggle { display: none; }
 .actions-menu { display: none !important; }
  .actions-menu.open { display: none !important; }
 .actions-menu .btn { width: 100%; margin-bottom: 8px; }
 .actions-menu .btn:hover { color: var(--menu-item-color); }
  #btnAcoesToggle { display: none; }
}

/* Desktop: manter ações inline e ocultar toggle */
@media (min-width: 769px) {
.actions-inline { display: inline-flex; gap: 8px; align-items: center; }
  .actions-toggle { display: none; }
  /* Ocultar dropdown de ações no desktop, mesmo que esteja "open" */
  .actions-menu { display: none !important; }
  .actions-menu.open, .actions-menu.closing { display: none !important; }
}

/* Animação do gradiente do topo */
@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
}

/* =========================
   Status Badges (Mensal)
   Verde: pagamento no mês | Vermelho: atrasado | Amarelo: pendente
*/
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}
.cell-status { display: inline-flex; max-width: 100%; overflow: hidden; }
td .cell-status { display: inline-flex; align-items: center; justify-content: flex-start; }
/* Evitar sobreposição em colunas estreitas */
td:nth-child(7) .cell-status, /* status em #tabelaEmprestimos */
td:nth-child(7) .status-badge,
td:nth-child(7) { overflow: visible; }
/* Permitir quebra elegante em telas menores */
.status-badge { text-overflow: ellipsis; }
.status-green {
  background: rgba(74, 222, 128, 0.12); /* usa --success-color tonalidade */
  color: var(--success-color);
  border: 1px solid rgba(74, 222, 128, 0.35);
}
.status-yellow {
  background: rgba(251, 191, 36, 0.15);
  color: #a07600;
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.status-red {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* Informação/Parcela */
.status-blue {
  background: rgba(13, 110, 253, 0.12);
  color: var(--info-color);
  border: 1px solid rgba(13, 110, 253, 0.35);
}

/* Responsivo para tabelas (web/mobile/tablet) */
@media (max-width: 768px) {
  .status-badge {
    font-size: 0.8rem;
    padding: 3px 8px;
  }
  td .cell-status { max-width: 100%; }
  /* Pagamentos status cell should not clip badges */
  #tabelaPagamentos td:nth-child(5) .status-badge { max-width: 100%; }
}
@media (max-width: 480px) {
  .status-badge {
    font-size: 0.75rem;
    padding: 2px 6px;
  }
  /* Ajuste extra para evitar overlap com botão de ações */
#tabelaEmprestimos td.acoes { flex-wrap: nowrap; gap: 8px; overflow-x: auto; }
#tabelaPendentes td.acoes { flex-wrap: nowrap; gap: 8px; overflow-x: auto; }
#tabelaTodosEmprestimos td.acoes { flex-wrap: nowrap; gap: 8px; overflow-x: auto; }

/* Responsividade: manter horizontal em telas menores */
@media (max-width: 640px) {
    td.acoes { flex-direction: row; gap: 8px; flex-wrap: nowrap; overflow-x: auto; }
}
  #tabelaEmprestimos td:nth-child(7) { white-space: nowrap; }
  /* Pagamentos: manter ações compactas e evitar quebra indesejada */
  #tabelaPagamentos td:nth-child(6) { white-space: nowrap; }
}
.btn.icon-only { padding: 0 10px; width: 40px; min-width: 40px; justify-content: center; }
.btn.icon-only .btn-icon { font-size: 18px; }

/* Footer Responsivo: evitar sobreposição e melhorar grid em mobile */
@media (max-width: 768px) {
  footer .footer-content { flex-direction: column; align-items: flex-start; gap: 10px; }
  footer .footer-links { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
  footer .copyright { grid-template-columns: 1fr; row-gap: 8px; }
  footer .copyright .version { order: -1; }
}

/* Legibilidade de textos em mobile */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .section p, .card p, .welcome-text p { line-height: 1.7; }
  .footer-links a { font-size: 13px; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .section p, .card p, .welcome-text p { font-size: 0.98rem; line-height: 1.75; }
}

/* Simulador de Parcelas */
.simulador-box {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 16px;
  margin-top: 16px;
}
.simulador-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.pill-simular {
  background: #34d399; /* green-400 */
  color: #0b1020;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
}
.simulador-item {
  background: #0f1b4f; /* navy-like */
  color: #ffffff;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.simulador-item-title { font-weight: 700; margin-bottom: 4px; }
.simulador-item-content { display: flex; align-items: center; justify-content: space-between; }
.simulador-item-valor { font-weight: 600; }
.simulador-item-data { opacity: 0.9; }
.simulador-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.simulador-summary .summary-item { display: flex; flex-direction: column; }

/* Parcelas modal: impedir quebra e alinhar colunas */
/* Nº */
#tabelaParcelas th:nth-child(1),
#tabelaParcelas td:nth-child(1) { text-align: center; }
/* Data de Vencimento */
#tabelaParcelas th:nth-child(2),
#tabelaParcelas td:nth-child(2) { text-align: center; white-space: nowrap; min-width: 120px; }
/* Valor */
#tabelaParcelas th:nth-child(3),
#tabelaParcelas td:nth-child(3) { white-space: nowrap; text-align: right; }
/* Valor Pago */
#tabelaParcelas th:nth-child(4),
#tabelaParcelas td:nth-child(4) { white-space: nowrap; text-align: right; }
/* Status */
#tabelaParcelas th:nth-child(5),
#tabelaParcelas td:nth-child(5) { text-align: center; }
/* Pago em */
#tabelaParcelas th:nth-child(6),
#tabelaParcelas td:nth-child(6) { white-space: nowrap; text-align: right; min-width: 120px; }

/* Status tags dentro do modal Parcelas */
#modalParcelas .status-badge { border-radius: 9999px; font-weight: 600; }
#modalParcelas .status-badge.status-green { color: #22c55e; background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.35); }
#modalParcelas .status-badge.status-yellow { color: #eab308; background: rgba(234,179,8,0.15); border: 1px solid rgba(234,179,8,0.35); }
#modalParcelas .status-badge.status-blue { color: #3b82f6; background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.35); }

/* =========================
   Botões: rótulos responsivos para mobile
   Mostrar rótulos curtos em telas pequenas e evitar overflow
*/
.btn .btn-text { display: inline; }
.btn .btn-text.mobile-only { display: none; }

@media (max-width: 768px) {
  .btn .btn-text.desktop-only { display: none; }
  .btn .btn-text.mobile-only { display: inline; }
  /* Compactar botões pequenos para caber melhor no mobile */
  .btn-sm { padding: 0.5rem 0.7rem; min-width: 92px; gap: 6px; }
  .btn-pay { padding: 0.5rem 0.85rem; min-width: 100px; }
  td.acoes .btn { min-width: 88px; }
  .acoes-wrap { display: inline-flex; gap: 8px; }
  .btn .btn-text { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}

@media (max-width: 480px) {
  .btn-sm { padding: 0.45rem 0.65rem; min-width: 84px; gap: 6px; }
  td.acoes { gap: 8px; }
}

/* ===== Modal de Parcelas (visual moderno e alinhado) ===== */
#modalParcelas .modal-content {
  max-width: 700px;
  padding: 24px;
  border-radius: 16px; /* cantos suaves */
  background-color: #0f172a; /* fundo azul escuro padrão */
  color: #f1f5f9; /* texto claro para contraste */
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3); /* sombra sutil e profunda */
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: modalFadeIn 0.25s ease-out; /* transição suave de entrada */
  transform-origin: center;
}
#modalParcelas h2 {
  margin: 0 0 12px 0;
  text-align: center;
  font-weight: 600; /* semibold */
  font-size: 1.2rem;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#modalParcelas .form-info {
  display: grid;
  grid-template-columns: 1fr;
  row-gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.dark #modalParcelas .form-info { background: rgba(255, 255, 255, 0.06); }
/* Padronização do bloco Cliente/Empréstimo */
#modalParcelas .form-info p { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#modalParcelas .form-info p strong { min-width: 110px; font-weight: 600; }
#modalParcelas .form-info p span { text-align: right; font-weight: 500; }

/* Tabela de parcelas: alinhamentos e espaçamentos consistentes */
#modalParcelas .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#tabelaParcelas { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: 12px; overflow: hidden; font-size: 0.9rem; }
#tabelaParcelas thead th { text-align: left; font-weight: 600; padding: 10px 16px; background-color: rgba(255, 255, 255, 0.05); color: #f1f5f9; }
#tabelaParcelas tbody td { padding: 10px 16px; vertical-align: middle; color: #f1f5f9; }
#tabelaParcelas tbody tr:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
#tabelaParcelas tbody tr:not(:last-child) td { border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
#modalParcelas .form-buttons { display: flex; justify-content: center; margin-top: 20px; }
#modalParcelas .form-buttons .btn { min-width: 120px; }
#modalParcelas .form-buttons .btn-outline { border-radius: 12px; background-color: #2563eb; color: #fff; border: none; }
#modalParcelas .form-buttons .btn-outline:hover { background-color: #1d4ed8; }

/* Responsivo para modal de parcelas */
@media (max-width: 768px) {
  #modalParcelas .modal-content { max-width: 95%; padding: 24px; }
  #tabelaParcelas thead th, #tabelaParcelas tbody td { padding: 8px 10px; }
}
@media (max-width: 480px) {
  #modalParcelas .modal-content { max-width: 95%; padding: 22px; }
  #modalParcelas .form-buttons { justify-content: center; }
  #modalParcelas .form-buttons .btn { width: 100%; }
}

/* ===== Padronização das Tabelas Principais ===== */
/* Empréstimos Ativos: 1 Cliente | 2 Data | 3 Valor | 4 Juros | 5 Parcelas | 6 Valor Parcela | 7 Status | 8 Data Prevista | 9 Ações */
#tabelaEmprestimos th:nth-child(2), #tabelaEmprestimos td:nth-child(2) { text-align: center; white-space: nowrap; min-width: 120px; }
#tabelaEmprestimos th:nth-child(3), #tabelaEmprestimos td:nth-child(3) { text-align: right; }
#tabelaEmprestimos th:nth-child(4), #tabelaEmprestimos td:nth-child(4) { text-align: right; }
#tabelaEmprestimos th:nth-child(6), #tabelaEmprestimos td:nth-child(6) { text-align: right; }
#tabelaEmprestimos th:nth-child(7), #tabelaEmprestimos td:nth-child(7) { text-align: center; }
#tabelaEmprestimos th:nth-child(8), #tabelaEmprestimos td:nth-child(8) { text-align: center; white-space: nowrap; min-width: 120px; }

/* Todos os Empréstimos (Página): 1 Cliente | 2 Valor | 3 Juros | 4 Parcelas | 5 Valor Parcela | 6 Data | 7 Status | 8 Ações */
#tabelaTodosEmprestimos th:nth-child(2), #tabelaTodosEmprestimos td:nth-child(2) { text-align: right; }
#tabelaTodosEmprestimos th:nth-child(3), #tabelaTodosEmprestimos td:nth-child(3) { text-align: right; }
#tabelaTodosEmprestimos th:nth-child(5), #tabelaTodosEmprestimos td:nth-child(5) { text-align: right; }
#tabelaTodosEmprestimos th:nth-child(6), #tabelaTodosEmprestimos td:nth-child(6) { text-align: center; white-space: nowrap; min-width: 120px; }
#tabelaTodosEmprestimos th:nth-child(7), #tabelaTodosEmprestimos td:nth-child(7) { text-align: center; }

/* Pendentes: 1 Cliente | 2 Valor Total | 3 Valor Pago | 4 Valor Pendente | 5 Parcelas Pendentes | 6 Ações */
#tabelaPendentes th:nth-child(2), #tabelaPendentes td:nth-child(2),
#tabelaPendentes th:nth-child(3), #tabelaPendentes td:nth-child(3),
#tabelaPendentes th:nth-child(4), #tabelaPendentes td:nth-child(4) { text-align: right; }
#tabelaPendentes th:nth-child(5), #tabelaPendentes td:nth-child(5) { text-align: center; }

/* =========================
   PRO UI Additions: Halo, Animations, Spacing, Mobile
   ========================= */
/* Brand logo halo wrapper */
.topbar .brand-logo {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}
.topbar .brand-logo::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(45% 45% at 50% 50%, rgba(37,99,235,0.55) 0%, rgba(37,99,235,0.15) 60%, transparent 100%);
  filter: blur(10px);
  opacity: 0.85;
  animation: haloPulse 3.6s ease-in-out infinite;
  pointer-events: none;
}
.topbar .brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 6px rgba(30,64,175,0.45));
}
@keyframes haloPulse {
  0%, 100% { transform: scale(0.98); opacity: 0.8; }
  50% { transform: scale(1.03); opacity: 0.95; }
}

/* Refine underline thickness for active nav items */
.nav-link::after { height: 3px; }

/* Increase spacing between actions buttons and avatar */
.nav-actions { gap: 12px; }

/* Dropdown animations (avatar and + Ações) */
.avatar-menu.open,
.actions-menu.open {
  animation: dropdownIn 180ms ease;
  transform-origin: top right;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: scale(0.98) translateY(-2px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Avatar subtle hover glow */
.avatar { transition: box-shadow 160ms ease, transform 100ms ease; }
.avatar:hover { box-shadow: 0 0 18px rgba(59,130,246,0.55); transform: translateY(-1px); }

/* Mobile: larger hit areas for actions and nav */
@media (max-width: 768px) {
  .nav-link { padding: 12px 14px; }
  .actions-menu .btn { padding: 12px 14px; }
}

/* Closing animation state */
.avatar-menu.closing,
.actions-menu.closing {
  display: block;
  animation: dropdownOut 150ms ease;
  transform-origin: top right;
}
@keyframes dropdownOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.98) translateY(-3px); }
}

/* Avatar subtle animated halo */
.avatar { position: relative; }
.avatar::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(40% 40% at 50% 50%, rgba(59,130,246,0.35), rgba(59,130,246,0) 60%);
  opacity: 0.5;
  filter: blur(8px);
  pointer-events: none;
  animation: avatarHaloPulse 2800ms ease-in-out infinite;
  z-index: -1;
}
@keyframes avatarHaloPulse {
  0% { opacity: 0.35; transform: scale(0.98); }
  50% { opacity: 0.55; transform: scale(1.02); }
  100% { opacity: 0.35; transform: scale(0.98); }
}

/* Ultra-compact phones */
@media (max-width: 380px) {
  .nav-link { padding: 8px 10px; height: 36px; }
  .nav-text { font-size: 12px; }
  .brand-text { font-size: 16px; }
  .btn { min-height: 42px; }
  .nav-actions { gap: 8px; }
  .actions-title { font-size: 11px; letter-spacing: .1em; }
}