/* RESET GLOBAL E FONTES */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f7f9;
    padding: 16px;
    max-width: 500px;
    margin: 0 auto;
    padding-bottom: 90px; /* espaço para o FAB */
}

/* NAVEGAÇÃO ENTRE TELAS */
.nav-tabs {
    display: flex;
    gap: 8px;
    background: #fff;
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 18px;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.nav-tab {
    flex: 1;
    text-align: center;
    padding: 10px 8px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    transition: all 0.15s;
}

.nav-tab.ativo {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: #fff;
}

/* Botão de tema (🌙/☀️) — não estica como as abas */
.btn-tema {
    flex: 0 0 auto;
    width: 44px;
    padding: 10px 0;
    font-size: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-tema:hover {
    background: rgba(0, 0, 0, 0.06);
}

html.dark .btn-tema:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ALERTA DE LIMITE (>= 80%) */
.alerta-limite {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
}

.alerta-limite-item + .alerta-limite-item {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #fecaca;
}

/* SELEÇÃO DE CARTÃO NOS GASTOS */
.linha-cartao {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.linha-cartao label {
    font-size: 12px;
    color: #64748b;
    font-weight: 700;
}

.sel-cartao {
    flex: 1;
    min-width: 180px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 13px;
    color: #1a202c;
    cursor: pointer;
}

.sel-cartao:focus {
    outline: none;
    border-color: #3b82f6;
}

.cartao-atribuido {
    font-size: 12px;
    font-weight: 700;
    color: #1e3a8a;
    background: #eef2ff;
    padding: 4px 10px;
    border-radius: 10px;
}

.cabecalho {
    text-align: center;
    margin-bottom: 24px;
    margin-top: 10px;
}

.cabecalho h1 {
    font-size: 28px;
    color: #1a202c;
    font-weight: 800;
}

.topo { 
    color: #6b7a94; 
    font-size: 14px;
    margin-top: 6px; 
}

/* DASHBOARD DE TOTAIS */
.caixa-total {
    text-align: center;
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
    color: white;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

.caixa-total p {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.total-gasto { 
    font-size: 42px; 
    font-weight: bold; 
    margin: 8px 0 0 0; 
}

/* BOTÃO DE CAPTURA FORENSE */
.botao-captura {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    color: #4a5568;
    border: 3px dashed #cbd5e0;
    display: block;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin-bottom: 24px;
}

.botao-captura:active {
    background-color: #f8fafc;
    border-color: #3b82f6;
    transform: scale(0.98);
}

.icone {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

input[type="file"] { 
    display: none; 
}

.lista {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* GAVETAS DO HISTÓRICO (ACCORDIONS) */
details.gaveta {
    background-color: #ffffff;
    border-radius: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #edf2f7;
    overflow: hidden;
}

summary.cabecalho-gaveta {
    padding: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1a202c;
    list-style: none; /* Oculta seta padrão Firefox/Edge */
}

summary.cabecalho-gaveta::-webkit-details-marker {
    display: none; /* Oculta seta Safari/Chrome */
}

.conteudo-gaveta {
    padding: 0 16px 16px 16px;
    border-top: 1px dashed #e2e8f0;
    margin-top: 8px;
    padding-top: 16px;
}

.itens {
    white-space: pre-line;
    font-size: 15px;
    line-height: 1.6;
    color: #4a5568;
}

/* CARDS DE RESUMO POR PAGAMENTO */
.total-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.btn-olho {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: transform 0.15s, background 0.15s;
}

.btn-olho:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: scale(1.1);
}

.btn-olho:active {
    transform: scale(0.9);
}

.card-pagamento {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 16px;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* GAVETA PRINCIPAL (lista de todos os cupons) */
.gaveta-principal {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    overflow: hidden;
    margin-bottom: 16px;
}

.cabecalho-gaveta-principal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
    color: #1e3a8a;
    font-size: 15px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    transition: background 0.15s;
}

.cabecalho-gaveta-principal:hover {
    background: linear-gradient(135deg, #f1f5f9, #e0e7ff);
}

.cabecalho-gaveta-principal::-webkit-details-marker {
    display: none;
}

.conteudo-gaveta-principal {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid #f1f5f9;
}

/* GAVETAS DE PAGAMENTO (expansíveis) */
.gaveta-pagamento {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #edf2f7;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    overflow: hidden;
}

.gaveta-pagamento[open] {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.cabecalho-gaveta-pag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    list-style: none;
    transition: background 0.15s;
}

.cabecalho-gaveta-pag:hover {
    background: #f8fafc;
}

.cabecalho-gaveta-pag::-webkit-details-marker {
    display: none;
}

.conteudo-gaveta-pag {
    padding: 4px 16px 14px 16px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Item de compra dentro da gaveta */
.compra-item {
    padding: 8px 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.compra-linha {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #1a202c;
}

.compra-valor {
    font-weight: 700;
    color: #1a202c;
    white-space: nowrap;
}

.compra-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 3px;
}

.card-pag-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-pag-emoji {
    font-size: 28px;
}

.card-pag-nome {
    font-size: 15px;
    font-weight: 700;
    color: #1a202c;
}

.bandeiras {
    display: inline-block;
    margin-top: 3px;
    font-size: 12px;
    color: #4a5568;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 10px;
}

.card-pag-valor {
    text-align: right;
}

.card-pag-valor strong {
    display: block;
    font-size: 16px;
    color: #1a202c;
}

.card-pag-qtd {
    font-size: 12px;
    color: #a0aec0;
}

/* Cores por tipo */
.pag-credito { border-left: 4px solid #7c3aed; }
.pag-debito { border-left: 4px solid #0891b2; }
.pag-refeicao { border-left: 4px solid #16a34a; }
.pag-dinheiro { border-left: 4px solid #d97706; }
.pag-pix { border-left: 4px solid #22d3ee; }
.pag-outro { border-left: 4px solid #6b7280; }
/* Botão sair (🚪) — igual ao tema, não estica */
.btn-sair {
    flex: 0 0 auto;
    width: 44px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
}

html.dark .btn-sair {
    border-color: #334155;
    color: #f87171;
}
