:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;

    --primary: #022c22;
    --primary-light: #0d9488;
    --accent: #10b981;

    --danger: #ef4444;
    --success: #10b981;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.02), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    
    background-color: var(--bg);
    background-image: 
        radial-gradient(at 50% 0%, rgba(13, 148, 136, 0.08) 0px, transparent 50%),
        linear-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 1px), 
        linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px); 
    background-size: 100% 100%, 24px 24px, 24px 24px;
    min-height: 100vh;
}

header {
    background: linear-gradient(135deg, var(--primary), #042f2e);
    position: relative;
    overflow: hidden;
    color: white;
    padding: 22px 20px;
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 320px;
    height: 320px;
    background: var(--primary-light);
    filter: blur(90px);
    opacity: 0.35;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.top {
    display: flex;
    align-items: center;
    gap: 16px;
}

header h1 {
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(to right, #ffffff, #ccfbf1);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.nav-btn {
    border: 0;
    background: rgba(255, 255, 255, 0.04);
    color: #ccfbf1;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
    background: #ffffff;
    color: var(--primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.page-title {
    margin-top: 36px;
    margin-bottom: 24px;
}

.page-title h2 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
}

.page-title p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.95rem;
}

.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
    margin-bottom: 120px;
}

#accountsGrid > div {
    background: var(--card) !important;
    border-radius: 16px !important;
    padding: 20px 24px !important;
    box-shadow: var(--shadow-sm) !important;
    border: 1px solid var(--border) !important;
    border-left: 5px solid var(--primary-light) !important;
}

.card {
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.account-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
}

.account-title {
    display: flex;
    flex-direction: column;
}

.account-title strong {
    font-size: 18px;
    font-weight: 600;
}

.account-number {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.balances {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.balance-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.balance-box span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 4px;
}

.balance-box strong {
    font-size: 18px;
    font-weight: 700;
}

.entries-section {
    margin-top: 20px;
}

.entries-section h4 {
    margin: 0 0 12px 0;
    font-weight: 600;
}

.entry-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.entry-item:last-child {
    border-bottom: 0;
}

.entry-left {
    display: flex;
    flex-direction: column;
}

.entry-desc {
    font-weight: 500;
}

.entry-date {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.entry-value {
    color: var(--success);
    font-weight: 700;
}

.empty {
    color: var(--muted);
}

.fab {
    position: fixed;
    right: 32px;
    bottom: 32px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(135deg, var(--primary-light), #0f766e);
    color: white;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(13, 148, 136, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 1000;
}

.overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 500px;
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.close-btn {
    border: 0;
    background: #f1f5f9;
    color: var(--text);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.menu-actions {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.menu-btn {
    border: 1px solid #e2e8f0;
    background: white;
    padding: 14px 18px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.menu-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.menu-actions.hidden-other .menu-btn {
    display: none;
}

.menu-actions.hidden-other .menu-btn.active {
    display: block;
}

.form-area {
    display: none;
    margin-top: 20px;
}

.form-area.active {
    display: block;
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
}

/* =========================================
   FORMULÁRIOS (Extremamente Simplificados)
   ========================================= */

input,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
    font-family: inherit;
}

/* Substituição do box-shadow por outline.
   O outline é desenhado fora do fluxo de renderização do CSS principal,
   evitando glitches de cor nos componentes nativos (calendários/selects).
*/
input:focus,
select:focus {
    outline: 2px solid var(--primary-light);
    outline-offset: -1px;
    border-color: transparent;
}

/* ========================================= */

.btn {
    border: 0;
    padding: 14px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--primary-light);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.message {
    margin-top: 14px;
    color: var(--muted);
    font-size: 14px;
}