/* ========================================
   POUPEI - Design System v4
   Desktop: Mordomize-inspired layout
   Mobile: Card-based vertical layout
   Azul #005CA9 | Laranja #F39200
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; overflow-x: hidden; }
body {
    font-family: 'Poppins', sans-serif;
    background: #F2F4F7;
    color: #1A1A2E;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ── Variáveis ── */
:root {
    --azul:        #005CA9;
    --azul-escuro: #004A8A;
    --azul-claro:  #E8F1FB;
    --azul-borda:  #BFDBF7;
    --amarelo:     #F39200;
    --amarelo-bg:  #FFF4E0;
    --branco:      #FFFFFF;
    --cinza-bg:    #F2F4F7;
    --cinza-card:  #F8F9FB;
    --cinza-borda: #E4E9F0;
    --cinza-texto: #6B7280;
    --titulo:      #1A1A2E;
    --verde:       #16A34A;
    --verde-bg:    #DCFCE7;
    --vermelho:    #DC2626;
    --vermelho-bg: #FEE2E2;
    --shadow-sm:   0 1px 3px rgba(0,0,0,.06);
    --shadow:      0 2px 8px rgba(0,0,0,.08);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
    --radius:      12px;
    --radius-sm:   8px;
    --radius-lg:   16px;
    --topbar-h:    56px;
    --sidebar-w:   210px;
}

/* ════════════════════════════════════════
   MODO EMPRESARIAL — inverte azul ↔ laranja
   Só troca as cores de marca/destaque. Verde
   e vermelho (significado financeiro) não
   são tocados de propósito.
   ════════════════════════════════════════ */
body.modo-pj,
html body.modo-pj {
    --azul:        #F39200;
    --azul-escuro: #CC7A00;
    --azul-claro:  #FFF4E0;
    --azul-borda:  #FFD599;
    --amarelo:     #005CA9;
    --amarelo-bg:  #E8F1FB;
}

/* ════════════════════════════════════════
   TOPBAR DESKTOP
   ════════════════════════════════════════ */
.topbar-desktop {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--branco);
    border-bottom: 1px solid var(--cinza-borda);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 300;
    box-shadow: var(--shadow-sm);
}
.topbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar-logo-icon { font-size: 24px; }
.topbar-logo-img { height: 30px; width: auto; display: block; }
.topbar-logo-nome {
    font-size: 20px;
    font-weight: 800;
    color: var(--azul);
    letter-spacing: -.5px;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Switch PF/PJ na topbar */
.topbar-switch {
    display: flex;
    background: var(--cinza-bg);
    border: 1px solid var(--cinza-borda);
    border-radius: 8px;
    padding: 3px;
    gap: 3px;
}
.tsw-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--cinza-texto);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.tsw-btn.ativo {
    background: var(--azul);
    color: var(--branco);
    box-shadow: var(--shadow-sm);
}

/* Avatar topbar */
.topbar-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--azul);
    color: var(--branco);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    transition: opacity .15s, box-shadow .15s;
}
.topbar-avatar:hover {
    opacity: .85;
    box-shadow: 0 0 0 3px var(--azul-claro);
}

/* Botão olho topbar */
.btn-privacidade-top {
    background: var(--cinza-bg);
    border: 1px solid var(--cinza-borda);
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 10px;
    color: var(--cinza-texto);
    transition: background .15s, border-color .15s;
    line-height: 1;
}
.btn-privacidade-top:hover {
    background: var(--azul-claro);
    border-color: var(--azul);
}

/* Topbar mobile oculta no desktop */
.topbar-mobile { display: none; }

/* ════════════════════════════════════════
   SIDEBAR DESKTOP
   ════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: var(--sidebar-w);
    height: calc(100vh - var(--topbar-h));
    background: var(--branco);
    border-right: 1px solid var(--cinza-borda);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
    transition: transform .3s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--cinza-borda); border-radius: 4px; }

/* Logo e switch mobile (ocultos no desktop) */
.sidebar-logo-mobile { display: none; }
.sidebar-switch-mobile { display: none; }

/* Navegação */
.sidebar-nav {
    padding: 12px 0 24px;
}
.nav-sep {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--cinza-texto);
    padding: 14px 18px 4px;
    opacity: .65;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 2px 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--cinza-texto);
    transition: background .15s, color .15s;
    position: relative;
    cursor: pointer;
}
.nav-item:hover {
    background: var(--cinza-bg);
    color: var(--titulo);
}
.nav-item.ativo {
    background: var(--azul) !important;
    color: var(--branco) !important;
    font-weight: 600;
}
.nav-icon { font-size: 18px; min-width: 22px; text-align: center; flex-shrink: 0; line-height: 1; }
.nav-item.ativo .nav-icon { color: var(--amarelo) !important; }
.nav-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-badge {
    background: var(--vermelho);
    color: var(--branco);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 99px;
    margin-left: auto;
    flex-shrink: 0;
}
.nav-item-sair:hover {
    background: var(--vermelho-bg) !important;
    color: var(--vermelho) !important;
}

/* Overlay mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 198;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.ativo { display: block; }

/* ════════════════════════════════════════
   CONTEÚDO PRINCIPAL
   ════════════════════════════════════════ */
.main-content {
    margin-left: var(--sidebar-w);
    margin-top: var(--topbar-h);
    min-height: calc(100vh - var(--topbar-h));
    padding: 28px 28px 40px;
    overflow-x: hidden;
}

/* ── Cabeçalho de página (título + botão ação) ── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}
.page-header-left { flex: 1; }
.page-header h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--titulo);
    line-height: 1.2;
    margin-bottom: 4px;
}
.page-header .page-sub {
    font-size: 14px;
    color: var(--cinza-texto);
    font-weight: 400;
}
.page-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding-top: 4px;
}

/* Compatibilidade com .page-title legado */
.page-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--titulo);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.page-title .icon { font-size: 24px; }

/* ════════════════════════════════════════
   CARDS
   ════════════════════════════════════════ */
.card {
    background: var(--branco);
    border-radius: var(--radius);
    border: 1px solid var(--cinza-borda);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
    overflow: hidden;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-titulo {
    font-size: 15px;
    font-weight: 700;
    color: var(--titulo);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Cards de resumo em linha (desktop) ── */
.cards-resumo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.card-resumo {
    background: var(--branco);
    border-radius: var(--radius);
    border: 1px solid var(--cinza-borda);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-resumo .cr-left { flex: 1; min-width: 0; }
.card-resumo .cr-label {
    font-size: 13px;
    color: var(--cinza-texto);
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-resumo .cr-valor {
    font-size: 22px;
    font-weight: 800;
    color: var(--titulo);
    line-height: 1.1;
}
.card-resumo .cr-sub {
    font-size: 12px;
    color: var(--cinza-texto);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.card-resumo .cr-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: var(--cinza-bg);
}
.card-resumo.verde   .cr-valor { color: var(--verde); }
.card-resumo.verde   .cr-icon  { background: var(--verde-bg); color: var(--verde); }
.card-resumo.vermelho .cr-valor { color: var(--vermelho); }
.card-resumo.vermelho .cr-icon  { background: var(--vermelho-bg); color: var(--vermelho); }
.card-resumo.azul    .cr-valor { color: var(--azul); }
.card-resumo.azul    .cr-icon  { background: var(--azul-claro); color: var(--azul); }
.card-resumo.amarelo .cr-valor { color: var(--amarelo); }
.card-resumo.amarelo .cr-icon  { background: var(--amarelo-bg); color: var(--amarelo); }

/* ── Grid 2 e 3 colunas ── */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ════════════════════════════════════════
   FILTROS (em linha no desktop)
   ════════════════════════════════════════ */
.filtros-card {
    background: var(--branco);
    border: 1px solid var(--cinza-borda);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}
.filtros-titulo {
    font-size: 14px;
    font-weight: 700;
    color: var(--titulo);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.filtros-linha {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 12px;
}
.filtros-linha .form-group {
    flex: 1;
    min-width: 140px;
    margin-bottom: 0;
}
.filtros-linha .form-group.wide { flex: 2; min-width: 220px; }
.filtros-acoes {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ════════════════════════════════════════
   BOTÕES
   ════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: filter .15s, transform .1s;
    line-height: 1;
    white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-primario  { background: var(--azul);    color: var(--branco); }
.btn-primario:hover  { filter: brightness(1.1); }
.btn-amarelo   { background: var(--amarelo); color: var(--branco); }
.btn-amarelo:hover   { filter: brightness(1.05); }
.btn-verde     { background: var(--verde);   color: var(--branco); }
.btn-verde:hover     { filter: brightness(1.1); }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--cinza-borda);
    color: var(--cinza-texto);
}
.btn-outline:hover { border-color: var(--cinza-texto); color: var(--titulo); background: var(--cinza-bg); }
.btn-outline-azul { background: transparent; border: 1.5px solid var(--azul); color: var(--azul); }
.btn-outline-azul:hover { background: var(--azul-claro); }
.btn-perigo    { background: var(--vermelho); color: var(--branco); }
.btn-perigo:hover    { filter: brightness(1.1); }
.btn-sm  { padding: 6px 13px; font-size: 13px; }
.btn-lg  { padding: 12px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }
/* alias */
.w-100 { width: 100%; }

/* ════════════════════════════════════════
   FORMULÁRIOS
   ════════════════════════════════════════ */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--titulo);
    margin-bottom: 5px;
}
.form-control {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--cinza-borda);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--titulo);
    background: var(--branco);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}
.form-control:focus {
    border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(0,92,169,.1);
}
.form-control::placeholder { color: #B0B8C9; }
textarea.form-control { resize: vertical; min-height: 90px; }
/* iOS Safari dá aos input[type=date/time] uma largura intrínseca que ignora
   width:100% e faz a página vazar. Resetar o appearance corrige isso. */
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
    -webkit-appearance: none;
    appearance: none;
    min-width: 0;
    max-width: 100%;
}
select.form-control {
    height: 44px;        /* mesma altura do input com padding:10px 13px + border */
    padding: 0 13px;
    appearance: auto;
    cursor: pointer;
    line-height: 44px;
}
.form-hint { font-size: 12px; color: var(--cinza-texto); margin-top: 3px; }

/* ════════════════════════════════════════
   TABELA
   ════════════════════════════════════════ */
.tabela-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.tabela th {
    background: var(--cinza-bg);
    color: var(--cinza-texto);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--cinza-borda);
    white-space: nowrap;
}
.tabela td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--cinza-borda);
    vertical-align: middle;
    color: var(--titulo);
}
.tabela tr:last-child td { border-bottom: none; }
.tabela tbody tr:hover td { background: var(--cinza-bg); }
.tabela .icon-col { text-align: center; font-size: 18px; }

/* ════════════════════════════════════════
   ESTADO VAZIO
   ════════════════════════════════════════ */
.estado-vazio {
    background: #EBF5FB;
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #2C5282;
    border: 1px solid #BEE3F8;
}

/* ════════════════════════════════════════
   LISTA DE ITENS
   ════════════════════════════════════════ */
.lista-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--cinza-borda);
}
.lista-item:last-child { border-bottom: none; }
.lista-item .li-icon {
    width: 38px; height: 38px;
    border-radius: 9px;
    background: var(--cinza-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
}
.lista-item .li-info { flex: 1; min-width: 0; }
.lista-item .li-titulo {
    font-size: 14px; font-weight: 600; color: var(--titulo);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lista-item .li-sub { font-size: 12px; color: var(--cinza-texto); margin-top: 2px; }
.lista-item .li-valor { font-size: 15px; font-weight: 700; text-align: right; white-space: nowrap; }
.li-valor.positivo { color: var(--verde); }
.li-valor.negativo { color: var(--vermelho); }

/* ════════════════════════════════════════
   BADGES
   ════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 600;
    padding: 3px 9px; border-radius: 99px;
}
.badge-ativo     { background: var(--verde-bg);    color: var(--verde); }
.badge-concluido { background: var(--azul-claro);  color: var(--azul); }
.badge-pausado   { background: var(--amarelo-bg);  color: #92400E; }
.badge-vencendo  { background: var(--vermelho-bg); color: var(--vermelho); }

/* ════════════════════════════════════════
   BARRA DE PROGRESSO
   ════════════════════════════════════════ */
.barra-wrap { margin: 8px 0; }
.barra-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--cinza-texto); margin-bottom: 5px; }
.barra-bg { background: var(--cinza-borda); border-radius: 99px; height: 8px; overflow: hidden; }
.barra-fill { height: 8px; border-radius: 99px; background: var(--azul); transition: width .5s ease; }
.barra-fill.verde   { background: var(--verde); }
.barra-fill.amarelo { background: var(--amarelo); }
.barra-fill.vermelho{ background: var(--vermelho); }

/* ════════════════════════════════════════
   ALERTAS
   ════════════════════════════════════════ */
.alerta {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    font-size: 14px; margin-bottom: 14px; border: 1px solid transparent;
}
.alerta-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alerta-azul    { background: #EBF5FB; color: #1E3A5F; border-color: #BEE3F8; }
.alerta-amarelo { background: var(--amarelo-bg); color: #78350F; border-color: #FCD34D; border-left: 4px solid var(--amarelo); }
.alerta-verde   { background: var(--verde-bg);   color: #14532D; border-color: #86EFAC; }
.alerta-vermelho{ background: var(--vermelho-bg);color: #7F1D1D; border-color: #FCA5A5; border-left: 4px solid var(--vermelho); }

/* ════════════════════════════════════════
   MODAL
   ════════════════════════════════════════ */
.modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.5); z-index: 9000;
    align-items: center; justify-content: center;
    padding: 16px; backdrop-filter: blur(2px);
}
.modal-overlay.ativo { display: flex; }
.modal {
    background: var(--branco); border-radius: var(--radius-lg);
    padding: 24px; width: 100%; max-width: 480px;
    max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalIn .2s ease;
}
@keyframes modalIn {
    from { transform: scale(.95) translateY(10px); opacity: 0; }
    to   { transform: scale(1)   translateY(0);    opacity: 1; }
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--cinza-borda);
}
.modal-titulo { font-size: 16px; font-weight: 700; color: var(--titulo); }
.modal-fechar {
    background: var(--cinza-bg); border: 1px solid var(--cinza-borda);
    border-radius: 6px; font-size: 15px; cursor: pointer;
    color: var(--cinza-texto); padding: 4px 8px; transition: background .15s;
}
.modal-fechar:hover { background: var(--cinza-borda); }

/* ════════════════════════════════════════
   TOAST
   ════════════════════════════════════════ */
#toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--titulo); color: var(--branco);
    padding: 12px 18px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg); z-index: 9999;
    display: none; align-items: center; gap: 8px; max-width: 300px;
}
#toast.ativo   { display: flex; }
#toast.sucesso { background: var(--verde); }
#toast.erro    { background: var(--vermelho); }

/* ════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════ */
.auth-wrap {
    min-height: 100vh; display: flex;
    align-items: flex-start; justify-content: center;
    background: var(--cinza-bg); padding: 40px 24px;
}
/* Login (2 colunas) centraliza vertical; cadastro (card único) alinha ao topo */
.auth-wrap:has(.auth-split:not(.auth-split-solo)) { align-items: center; }

/* ── Layout de login em 2 colunas (estilo Mordomize) ── */
.auth-split {
    display: flex;
    width: 100%;
    max-width: 1040px;
    min-height: 580px;
    background: var(--branco);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    border: 1px solid var(--cinza-borda);
}
/* Cadastro: card único centralizado (sem painel lateral), estilo Mordomize */
.auth-split.auth-split-solo {
    max-width: 460px;
    min-height: 0;
}
.auth-split.auth-split-solo .auth-form-side {
    flex: 1 1 100%;
    padding: 40px 36px;
}
/* Fonte um pouco maior no cadastro pra melhor leitura */
.auth-split.auth-split-solo .form-group label {
    font-size: 15px;
}
.auth-split.auth-split-solo .form-control {
    font-size: 15px;
    padding: 12px 14px;
}
/* Painel colorido à esquerda */
.auth-hero {
    flex: 1 1 50%;
    background: linear-gradient(160deg, var(--azul) 0%, var(--azul-escuro) 100%);
    color: #fff;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.auth-hero::after {
    /* Onda decorativa no rodapé do painel */
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px; height: 90px;
    background: rgba(255,255,255,.08);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transform: scaleX(1.5);
}
.auth-hero-titulo {
    font-size: 30px; font-weight: 800; line-height: 1.15;
    margin-bottom: 18px;
    text-align: center;
}
.auth-hero-sub {
    font-size: 15px; line-height: 1.5; opacity: .92;
    margin-bottom: 32px;
}
.auth-beneficio {
    display: flex; align-items: flex-start; gap: 14px;
    margin-bottom: 18px;
    position: relative; z-index: 1;
}
.auth-beneficio-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,.18);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
    color: #fff;
}
.auth-beneficio-icon i { color: #fff; }
.auth-beneficio-txt { font-size: 14px; line-height: 1.4; opacity: .95; padding-top: 8px; }

/* Lado do formulário */
.auth-form-side {
    flex: 1 1 50%;
    padding: 44px 48px;
    display: flex; flex-direction: column; justify-content: center;
}
/* Fonte um pouco maior nos formulários de auth (login e cadastro) pra facilitar leitura */
.auth-form-side .form-group label {
    font-size: 15px;
}
.auth-form-side .form-control {
    font-size: 15px;
    padding: 12px 14px;
}
.auth-lembrar { font-size: 15px; }

.auth-box {
    background: var(--branco); border-radius: var(--radius-lg);
    padding: 36px 32px; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg); border: 1px solid var(--cinza-borda);
}
.auth-logo { text-align: center; margin-bottom: 20px; }
.auth-logo .logo-icon { font-size: 44px; }
.auth-logo .logo-nome { font-size: 26px; font-weight: 800; color: var(--azul); margin-top: 4px; }
.auth-logo .logo-slogan { font-size: 14px; color: var(--cinza-texto); margin-top: 4px; }
.auth-logo-img { height: 52px; width: auto; margin: 0 auto; display: block; }
.auth-link { text-align: center; margin-top: 18px; font-size: 14px; color: var(--cinza-texto); }
.auth-link a { color: var(--laranja); font-weight: 600; }

/* ── Login estilo Mordomize (cor laranja da marca) ── */
:root { --laranja: #F39200; --laranja-escuro: #CC7A00; }

/* Painel lateral do login em azul (cor principal do app) */
.auth-hero {
    background: linear-gradient(160deg, var(--azul) 0%, var(--azul-escuro) 100%);
}
/* Título e subtítulo "Faça seu login" */
.auth-form-titulo {
    text-align: center;
    font-size: 26px; font-weight: 800; color: var(--titulo);
    margin-bottom: 4px;
}
.auth-form-sub {
    text-align: center;
    font-size: 14px; color: var(--cinza-texto);
    margin-bottom: 26px;
}
/* Frase única do cadastro (estilo Mordomize) — maior e com respiro */
.auth-form-sub-cadastro {
    font-size: 18px;
    margin-top: 8px;
    margin-bottom: 30px;
}
/* Checkbox "Lembrar meu e-mail" */
.auth-lembrar {
    display: flex; align-items: center; gap: 9px;
    font-size: 14px; color: var(--cinza-texto);
    cursor: pointer; margin: 4px 0 4px;
    user-select: none;
}
.auth-lembrar input[type="checkbox"] {
    width: 18px; height: 18px; cursor: pointer;
    accent-color: var(--laranja);
}
/* Botão Entrar em azul (cor principal) */
.auth-btn-entrar {
    background: var(--azul) !important;
    font-size: 16px; font-weight: 700;
    border-radius: var(--radius-sm);
}
.auth-btn-entrar:hover { background: var(--azul-escuro) !important; }
.auth-btn-entrar i { color: #fff !important; }
/* Botão Finalizar Cadastro — azul principal do Poupei */
.auth-btn-cadastro {
    background: var(--azul) !important;
    color: #fff !important;
    font-size: 16px; font-weight: 700;
    border-radius: var(--radius-sm);
}
.auth-btn-cadastro:hover { background: var(--azul-escuro) !important; }
.auth-btn-cadastro i { color: #fff !important; }
/* "Esqueci minha senha" em destaque (laranja, negrito) */
.auth-esqueci { text-align: center; margin-top: 22px; }
.auth-esqueci a {
    color: var(--laranja); font-weight: 700; font-size: 15px;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 6px;
}
.auth-esqueci a:hover { text-decoration: underline; }
.auth-esqueci a i { color: var(--laranja); }
/* Rodapé copyright */
.auth-copyright {
    text-align: center; margin-top: 28px;
    font-size: 13px; color: var(--cinza-texto);
}

/* No mobile, esconde o painel lateral e mostra só o formulário */
@media (max-width: 820px) {
    .auth-split {
        flex-direction: column;
        max-width: 440px;
    }
    .auth-hero { display: none; }
    .auth-form-side { padding: 36px 26px; }
    /* Cadastro (card único) também acompanha a largura da tela */
    .auth-split.auth-split-solo { max-width: 440px; }
}
@media (max-width: 480px) {
    .auth-wrap { padding: 14px; align-items: flex-start; }
    .auth-split, .auth-split.auth-split-solo { max-width: 100%; }
    .auth-form-side,
    .auth-split.auth-split-solo .auth-form-side { padding: 28px 20px; }
}

/* ════════════════════════════════════════
   NOTA CARD
   ════════════════════════════════════════ */
.nota-card {
    background: var(--amarelo-bg); border-left: 4px solid var(--amarelo);
    border-radius: var(--radius-sm); padding: 14px 16px;
    margin-bottom: 12px; position: relative;
}
.nota-card.fixada { border-left-color: var(--amarelo); background: var(--amarelo-bg); }
.nota-card .nota-tipo { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cinza-texto); margin-bottom: 5px; display: flex; align-items: center; gap: 4px; }
.nota-card .nota-titulo { font-size: 14px; font-weight: 700; margin-bottom: 5px; color: var(--titulo); }
.nota-card .nota-conteudo { font-size: 13px; color: #444; line-height: 1.6; white-space: pre-wrap; }
.nota-card .nota-meta-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--amarelo); background: var(--branco); padding: 4px 10px; border-radius: 99px; }
.nota-card .nota-acoes { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.nota-card .nota-acoes button { background: none; border: none; font-size: 15px; cursor: pointer; opacity: .5; transition: opacity .2s; }
.nota-card .nota-acoes button:hover { opacity: 1; }

/* ════════════════════════════════════════
   RANKING
   ════════════════════════════════════════ */
.ranking-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--cinza-borda); }
.ranking-item:last-child { border-bottom: none; }
.rank-pos { font-size: 18px; font-weight: 800; min-width: 28px; text-align: center; color: var(--cinza-texto); }
.rank-pos.ouro   { color: #D97706; }
.rank-pos.prata  { color: #6B7280; }
.rank-pos.bronze { color: #92400E; }

/* ── Seletor de ícones (categorias, metas, cofrinhos, notas, dívidas) ── */
.emoji-grade {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
    max-height: 220px; overflow-y: auto; padding: 4px 2px;
}
.emoji-opcao {
    width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px; background: var(--cinza-card); border: 2px solid var(--cinza-borda);
    border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
    padding: 0; flex-shrink: 0;
}
.emoji-opcao:hover { border-color: var(--azul); background: var(--azul-claro); transform: translateY(-2px); }
.emoji-opcao:active { transform: scale(.95); }
.emoji-opcao.selecionado { background: var(--azul-claro); border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0,92,169,.12); }
.icone-preview {
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 19px; background: var(--cinza-card); border-radius: 50%; vertical-align: middle;
}

/* ════════════════════════════════════════
   PRIVACIDADE
   ════════════════════════════════════════ */
.valor-privado { transition: opacity .15s; }

/* ════════════════════════════════════════
   UTILITÁRIOS
   ════════════════════════════════════════ */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0 !important; }
.flex  { display: flex; }
.flex-center  { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.divider { border: none; border-top: 1px solid var(--cinza-borda); margin: 14px 0; }
.hidden { display: none; }

/* ════════════════════════════════════════
   RESPONSIVO MOBILE (≤768px)
   ════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Esconde topbar e sidebar desktop */
    .topbar-desktop { display: none; }
    .sidebar-logo-mobile {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 16px 18px;
        border-bottom: 1px solid var(--cinza-borda);
        font-size: 18px;
        font-weight: 800;
        color: var(--azul);
    }
    .sidebar-logo-img-mobile { height: 26px; width: auto; }
    .topbar-mobile .topbar-logo-img { height: 26px; }
    .sidebar-logo-mobile .sidebar-fechar {
        margin-left: auto;
        background: none; border: none;
        font-size: 20px; cursor: pointer;
        color: var(--cinza-texto);
    }
    .sidebar-switch-mobile {
        display: flex;
        margin: 10px 12px;
        background: var(--cinza-bg);
        border-radius: 10px;
        padding: 3px;
        gap: 2px;
        border: 1px solid var(--cinza-borda);
    }
    .ssw-btn {
        flex: 1; text-align: center;
        padding: 7px 4px; border-radius: 8px;
        font-size: 12px; font-weight: 600;
        color: var(--cinza-texto); transition: background .2s, color .2s;
    }
    .ssw-btn.ativo { background: var(--azul); color: var(--branco); }

    /* Topbar mobile aparece — FIXA no topo (fixed em vez de sticky, pois
       overflow-x:hidden nos pais quebra o sticky no Safari/iOS) */
    .topbar-mobile {
        display: flex;
        position: fixed; top: 0; left: 0; right: 0;
        background: var(--branco);
        border-bottom: 1px solid var(--cinza-borda);
        padding: 0 16px; height: 52px;
        align-items: center; justify-content: space-between;
        z-index: 300; box-shadow: var(--shadow-sm);
    }
    .topbar-mobile .topbar-logo { gap: 6px; font-size: 18px; }
    .topbar-logo-nome { font-weight: 800; color: var(--azul); }
    .btn-menu-mobile {
        background: none; border: none;
        font-size: 22px; cursor: pointer;
        color: var(--titulo); padding: 4px;
    }

    /* Sidebar desliza pela esquerda — começa abaixo da topbar fixa (52px) e
       usa 100dvh (altura dinâmica que desconta as barras do Safari iOS), com
       fallback pra calc(100vh - 52px). Assim TODAS as abas ficam alcançáveis. */
    .sidebar {
        top: 52px;
        height: calc(100vh - 52px);
        height: calc(100dvh - 52px);
        transform: translateX(-100%);
        box-shadow: none;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .sidebar.aberta {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }
    /* Espaço extra no fim da navegação pra última aba não colar na borda */
    .sidebar-nav { padding-bottom: 40px; }

    /* Conteúdo sem margin da sidebar; padding-top compensa a topbar fixa (52px) */
    .main-content {
        margin-left: 0; margin-top: 0;
        padding: 68px 14px 100px;
        min-height: 100vh;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Cards de resumo empilhados no mobile */
    .cards-resumo {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    /* Estilo Mordomize: cards de resumo mais limpos, sem o ícone grande à direita */
    .card-resumo .cr-icon { display: none; }
    .card-resumo { padding: 16px 18px; }

    /* Grid volta pra 1 coluna */
    .grid-2, .grid-3 { grid-template-columns: 1fr; }

    /* Layout principal do dashboard empilha no mobile */
    .dash-layout { grid-template-columns: 1fr !important; }

    /* Grids de 3 colunas (mercado, relatórios) empilham no mobile */
    .grid-auto3 { grid-template-columns: 1fr !important; }

    /* Filtros em coluna */
    .filtros-linha { flex-direction: column; }
    .filtros-linha .form-group,
    .filtros-linha .form-group.wide { min-width: 100%; }

    /* Modal */
    .modal { padding: 20px 16px; }
    .auth-box { padding: 28px 20px; }

    /* Page header empilha */
    .page-header { flex-direction: column; align-items: flex-start; }
    .page-header-actions { width: 100%; }

    /* ── Dashboard mobile: resumo financeiro empilhado (estilo Mordomize) ── */
    /* O bloco topo do resumo vira coluna: texto em cima, controles embaixo */
    .resumo-topo {
        flex-direction: column;
        align-items: stretch !important;
        gap: 14px !important;
    }
    .resumo-info {
        flex: none !important;
        width: 100%;
    }
    /* Controles de período ocupam a largura toda, sem sobrepor o texto */
    .resumo-controles {
        width: 100%;
        flex-shrink: 1 !important;
        gap: 8px !important;
    }
    .resumo-controles .periodo-tabs {
        flex: 1;
        justify-content: space-around;
    }
    .resumo-controles .periodo-tabs a {
        flex: 1;
        text-align: center;
    }
    .resumo-controles .btn-personalizar {
        justify-content: center;
        padding: 8px 12px !important;
    }

    /* Estado vazio no mobile: padding menor e texto que quebra sem vazar */
    .estado-vazio {
        padding: 14px 14px;
        font-size: 13px;
        align-items: flex-start;
    }
    .estado-vazio > * { min-width: 0; }

    /* Filtro de datas dos Relatórios: ocupa a largura toda e não vaza */
    .page-header-actions { width: 100%; }
    .relatorios-filtro {
        width: 100%;
        flex-wrap: wrap;
    }
    .relatorios-filtro input[type="date"] {
        width: auto !important;
        flex: 1 1 45%;
        min-width: 0;
    }
    .relatorios-filtro .btn-primario {
        flex: 1 1 100%;
        justify-content: center;
    }

    /* Grid de parcelas do IR: 4 colunas não cabem no celular, viram 2 */
    .parcelas-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Chips de filtro (Metas, Cofrinhos): quebram e crescem pra não vazar */
    .filtro-chips {
        width: 100%;
    }
    .filtro-chips .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .cards-resumo .cr-valor { font-size: 20px; }
    .page-title { font-size: 22px; }
}

/* ════════════════════════════════════════
   PERFIL — responsivo
   ════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Grid de editar+senha vira coluna */
    .perfil-grid-2 { grid-template-columns: 1fr !important; }

    /* perfil-grid-mordomize é flexbox com wrap — empilha sozinho,
       só garantimos que cada coluna ocupe 100% da largura */
    .perfil-grid-mordomize > div { flex-basis: 100% !important; min-width: 100% !important; }

    /* Stats do perfil: 2 colunas no mobile */
    .perfil-stats { grid-template-columns: repeat(2, 1fr) !important; }
    .perfil-stats > div { border-right: none !important; border-bottom: 1px solid var(--cinza-borda); }
    .perfil-stats > div:last-child { border-bottom: none; }
}

/* ════════════════════════════════════════
   BADGE DE NÍVEL/RANKING — topbar
   Layout estilo Utmify: linha de cima com
   ícone+nome+pontos, barra full-width embaixo
   ════════════════════════════════════════ */
.nivel-badge {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--cinza-bg);
    border: 1px solid var(--cinza-borda);
    border-left: 3px solid var(--amarelo);
    border-radius: 8px;
    padding: 5px 14px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    flex-shrink: 0;
    min-width: 200px;
}
.nivel-badge:hover {
    border-color: var(--amarelo);
    background: var(--amarelo-bg);
}

.nivel-badge-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Círculo do ícone (muda de cor/ícone por nível) */
.nivel-badge-icon-circle {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nivel-badge-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--azul);
    white-space: nowrap;
}
.nivel-badge-valores {
    font-size: 12px;
    font-weight: 500;
    color: var(--cinza-texto);
    white-space: nowrap;
    margin-left: auto;
}

/* Barra ocupa 100% da largura do badge */
.nivel-badge-bar {
    display: block;
    width: 100%;
    height: 4px;
    background: var(--cinza-borda);
    border-radius: 99px;
    overflow: hidden;
}
.nivel-badge-bar-fill {
    display: block;
    height: 4px;
    border-radius: 99px;
    transition: width .5s ease;
}

@media (max-width: 980px) {
    .nivel-badge { min-width: 170px; }
}
@media (max-width: 768px) {
    .nivel-badge { display: none; }
}

/* Painel de período personalizado */
.painel-personalizar {
    display: none;
    background: var(--branco);
    border: 1px solid var(--cinza-borda);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
}
.painel-personalizar.ativo-periodo {
    display: block;
}
/* ════════════════════════════════════════
   AVISOS FINANCEIROS — pop-up central (PC)
   ════════════════════════════════════════ */
.aviso-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    display: none;
    align-items: center; justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: avisoFadeIn .2s ease;
}
.aviso-overlay.ativo { display: flex; }
@keyframes avisoFadeIn { from { opacity: 0; } to { opacity: 1; } }
.aviso-box {
    background: var(--branco);
    border-radius: var(--radius-lg);
    max-width: 400px; width: 100%;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: avisoPop .25s ease;
}
@keyframes avisoPop { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.aviso-topo {
    padding: 20px 24px 16px;
    text-align: center;
    color: #fff;
}
.aviso-topo .aviso-icone {
    font-size: 40px; line-height: 1; margin-bottom: 8px; display: block;
}
.aviso-topo .aviso-titulo { font-size: 18px; font-weight: 700; }
.aviso-corpo { padding: 20px 24px 24px; }
.aviso-corpo .aviso-msg { font-size: 14px; line-height: 1.6; color: var(--titulo); text-align: center; }
.aviso-perguntas {
    margin-top: 16px; padding: 16px;
    background: var(--amarelo-bg);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--amarelo);
}
.aviso-perguntas ol { margin: 0; padding-left: 20px; }
.aviso-perguntas li { font-size: 13px; color: var(--titulo); margin-bottom: 6px; line-height: 1.5; }
.aviso-perguntas .aviso-frase-final { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--amarelo); text-align: center; }
.aviso-btn {
    margin-top: 20px; width: 100%;
    padding: 12px; border: none; border-radius: var(--radius-sm);
    font-size: 15px; font-weight: 700; color: #fff; cursor: pointer;
    transition: filter .15s;
}
.aviso-btn:hover { filter: brightness(1.08); }
.aviso-contador {
    text-align: center; font-size: 12px; color: var(--cinza-texto); margin-top: 10px;
}