:root {
    --bg: #0b0f19;
    --card: #151c2c;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --green: #22c55e;
    --red: #ef4444;
    --warning: #f59e0b;
    --border: #1e293b;
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden { display: none !important; }

/* Identidade Visual / Logo */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.brand-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    stroke: var(--accent);
}

.logo-icon-sm {
    width: 28px;
    height: 28px;
    stroke: var(--accent);
}

/* Layout */
.dashboard-container {
    width: 100%;
    max-width: 1100px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.navbar h1 {
    font-size: 1.4rem;
    font-weight: 600;
}

#logout-btn {
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    padding: 0.4rem 0.9rem;
    cursor: pointer;
    border-radius: 6px;
}

#logout-btn:hover {
    background: var(--red);
    color: var(--text);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.card {
    background: var(--card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    height: fit-content;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

form { 
    display: flex; 
    flex-direction: column; 
    gap: 0.9rem; 
}

input, select, button {
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #0f172a;
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
}

.checkbox-label input {
    cursor: pointer;
}

button[type="submit"] {
    background: var(--accent);
    border: none;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}

button[type="submit"]:hover {
    background: var(--accent-hover);
}

/* Lista de Transações */
ul { list-style: none; }

li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.transacao-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.transacao-titulo {
    font-weight: 600;
}

.transacao-detalhes {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.transacao-valores {
    text-align: right;
}

.status-tag {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.4rem;
}

.tag-pago { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.tag-pendente { background: rgba(245, 158, 11, 0.15); color: var(--warning); }

.receita { color: var(--green); font-weight: 600; }
.despesa { color: var(--red); font-weight: 600; }

/* Botão para alternar status direto na lista */
.btn-status {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-status:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.transacao-acoes {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.3rem;
    justify-content: flex-end;
}
/* Botão de excluir transação */
.btn-excluir {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--red);
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-excluir:hover {
    background: var(--red);
    color: #ffffff;
    border-color: var(--red);
}
/* Botão de Editar */
.btn-editar {
    background: transparent;
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: var(--accent);
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-editar:hover {
    background: var(--accent);
    color: #ffffff;
}

/* Modal Estilizado */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-card {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1.8rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-card h3 {
    font-size: 1.2rem;
    color: var(--text);
}

.modal-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

#modal-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-modal-cancel {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-modal-cancel:hover {
    background: var(--border);
    color: var(--text);
}

.btn-modal-confirm {
    background: var(--accent);
    color: #ffffff;
}
/* Cards de Resumo */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.summary-card span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.summary-card h2 {
    font-size: 1.6rem;
}

.balanco-positivo {
    color: var(--green);
}

.balanco-negativo {
    color: var(--red);
}

/* Ações de Exportação */
.header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.export-btns {
    display: flex;
    gap: 0.5rem;
}

.btn-export {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
}

.btn-export.excel {
    background: #107c41;
    color: #ffffff;
}

.btn-export.pdf {
    background: #e11d48;
    color: #ffffff;
}

/* Gráfico */
.chart-section {
    width: 100%;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    margin-top: 1rem;
}