:root {
    --bg-dark: #0f172a;
    --text-light: #f8fafc;
    --text-dim: #94a3b8;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --accent: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

/* Background Blobs */
.bg-blobs {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}
.blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    animation: float 20s infinite alternate linear;
}
.blob-1 { top: -10%; left: -10%; width: 50vw; height: 50vw; background: #3b82f6; animation-delay: 0s; }
.blob-2 { bottom: -10%; right: -10%; width: 60vw; height: 60vw; background: #8b5cf6; animation-delay: -5s; }
.blob-3 { top: 40%; left: 40%; width: 40vw; height: 40vw; background: #0f766e; animation-delay: -10s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.1); }
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 80px;
}

/* Glassmorphism Classes */
.glass-card, .glass-panel, .glass-form, .glass-header {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid rgba(255,255,255,0.2);
    border-left: 1px solid rgba(255,255,255,0.1);
    box-shadow: var(--shadow-soft);
    border-radius: 20px;
}

/* Header */
.glass-header {
    padding: 24px;
    margin-bottom: 30px;
    text-align: center;
    border-radius: 24px;
}

.user-greeting h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 4px;
}

.user-greeting p {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 20px;
}

.month-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 100px;
    border: 1px solid var(--glass-border);
}

.month-selector h2 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-icon {
    background: none; border: none;
    color: var(--text-light);
    font-size: 18px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 50%;
    transition: 0.3s;
}
.btn-icon:hover { background: rgba(255,255,255,0.1); }

/* Sections */
.section-container {
    margin-bottom: 35px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-left: 8px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 600;
    color: #e2e8f0;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 35px;
}

.card {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover { transform: translateY(-3px); }

.card-total { grid-column: 1 / -1; background: linear-gradient(135deg, rgba(30,58,138,0.7), rgba(59,130,246,0.3)); border-color: rgba(59,130,246,0.5); }
.card-pessoal { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }
.card-empresa { background: rgba(139, 92, 246, 0.1); border-color: rgba(139, 92, 246, 0.3); }
.card-terceiros { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); }

.card-status-pending { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }
.card-status-paid { background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.5); }


.card-icon {
    font-size: 28px;
    width: 45px; height: 45px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
}

.card-info h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.card-info p {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}
.card-total .card-info p { font-size: 24px; color: #60a5fa; }

/* Bank Grid */
.bank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}
.bank-card-mini {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex; flex-direction: column;
    gap: 6px;
}
.bank-card-mini span.bname { font-size: 13px; color: var(--text-dim); }
.bank-card-mini span.bval { font-size: 16px; font-weight: 600; color: #fff; }

/* Forms */
.glass-form {
    padding: 24px;
    display: flex; flex-direction: column; gap: 16px;
}

.form-row {
    display: flex; gap: 16px;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

@media (max-width: 500px) {
    .form-row { flex-direction: column; gap: 16px; }
}

.form-group {
    display: flex; flex-direction: column; gap: 8px; width: 100%;
}

label { font-size: 13px; color: var(--text-dim); font-weight: 500; }

input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="month"], select {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: 0.3s;
}

input:focus, select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(0,0,0,0.4);
}
select option { background: var(--bg-dark); color: white; }

.installment-input {
    position: relative;
    display: flex; align-items: center;
}
.installment-input input { padding-right: 35px; }
.installment-input span {
    position: absolute; right: 16px;
    color: var(--text-dim); font-weight: 600; font-size: 16px;
}

.dropdown-wrapper {
    display: flex; gap: 8px;
}
.btn-mini-add {
    background: var(--primary);
    color: white; border: none; border-radius: 12px;
    width: 50px; cursor: pointer; font-size: 20px; font-weight: 400;
    transition: 0.3s;
}
.btn-mini-add:hover { background: #2563eb; }

/* Focus Status Radios */
.status-toggle {
    display: flex; gap: 8px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 4px; border: 1px solid var(--glass-border);
}
.status-toggle input { display: none; }
.status-toggle label {
    flex: 1; text-align: center; padding: 10px;
    border-radius: 8px; cursor: pointer; transition: 0.3s;
    font-size: 14px; font-weight: 600; color: var(--text-dim);
}
#status-pending:checked + .lbl-pending { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
#status-paid:checked + .lbl-paid { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

.helper-text { font-size: 12px; color: #fbbf24; text-align: center; margin-top: 4px; }

.btn-submit {
    margin-top: 10px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    color: white; border: none; border-radius: 14px;
    padding: 16px; font-size: 16px; font-weight: 600;
    cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px;
    transition: 0.3s transform, 0.3s box-shadow;
}
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px #8b5cf6;
}
.btn-.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.4);
}
.summary-breakdown {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 13px;
    color: #94a3b8;
}
.breakdown-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    align-items: center;
}
.breakdown-item span:first-child {
    font-weight: 500;
}
.breakdown-item span:last-child {
    color: #cbd5e1;
    font-weight: 700;
}
.icon-submit { width: 20px; height: 20px; }

/* Transactions */
.transactions-container {
    display: flex; flex-direction: column; overflow: hidden;
}
.trans-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--glass-highlight);
    animation: fadeIn 0.4s ease forwards;
}
.trans-item:last-child { border-bottom: none; }

.trans-main { display: flex; flex-direction: column; gap: 6px; }
.trans-desc { font-weight: 600; font-size: 15px; }
.trans-tags { display: flex; gap: 6px; font-size: 11px; flex-wrap: wrap; }
.tag {
    padding: 2px 8px; border-radius: 4px; background: rgba(255,255,255,0.1);
    color: #cbd5e1; font-weight: 500;
}
.tag.pessoal { color: #6ee7b7; background: rgba(16, 185, 129, 0.15); }
.tag.empresa { color: #c084fc; background: rgba(139, 92, 246, 0.15); }
.tag.terceiros { color: #fcd34d; background: rgba(245, 158, 11, 0.15); }
.tag.entrada { color: #a3e635; background: rgba(132, 204, 22, 0.15); }
.tag.inst { color: #94a3b8; border: 1px solid #475569; }

.trans-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.trans-val { font-weight: 700; font-size: 16px; }
.trans-val.income { color: #34d399; }
.trans-val.expense { color: #f87171; }

.status-badge { font-size: 10px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.status-badge.pending { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.status-badge.paid { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }

.btn-del {
    background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; padding: 0 8px; transition: 0.2s;
}
.btn-del:hover { color: var(--danger); }

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

/* Custom Groups */
.owner-group-container {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    margin-bottom: 30px;
    padding: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}
.owner-group-title {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-left: 5px solid #10b981;
    margin: -18px -18px 20px -18px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    padding: 15px 20px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.bank-columns-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}
.owner-wrapper {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 14px;
    margin-bottom: 25px;
    padding: 15px;
}
.owner-wrapper:last-child {
    margin-bottom: 10px;
}
.type-group-title {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.1);
    font-size: 15px;
    font-weight: 700;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid #c084fc;
}
.type-group-container {
    flex: 1;
    min-width: 250px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    overflow: hidden;
}
.col-title {
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}
.type-group-container .trans-item {
    border-bottom: 1px dashed rgba(255,255,255,0.05);
}
.type-group-container .trans-item:last-child {
    border-bottom: none;
}
.split-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    border: 1px solid rgba(245, 158, 11, 0.3);
    vertical-align: middle;
    text-transform: none;
}

/* Empty State */
.empty-state {
    padding: 30px; text-align: center; color: var(--text-dim); font-size: 14px;
}

/* Footer / Toasts */
.glass-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; margin-top: 20px;
}
.glass-footer p { font-size: 12px; color: var(--text-dim); }
.btn-text { background: none; border: none; font-size: 13px; font-family: inherit; font-weight: 600; cursor: pointer; }
.btn-text.danger { color: #ef4444; }

.alert-toast {
    position: fixed; bottom: -50px; left: 50%; transform: translateX(-50%);
    background: var(--success); color: white; padding: 12px 24px; border-radius: 100px;
    font-weight: 600; box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
}
.alert-toast.show { bottom: 30px; }
.alert-toast.error { background: var(--danger); box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4); }

.toast-notification {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: var(--glass-bg); backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: 16px;
    padding: 16px; display: flex; align-items: center; gap: 12px;
    box-shadow: var(--shadow-soft); z-index: 999;
    transition: 0.3s;
}
.toast-notification.hidden { top: -100px; opacity: 0; pointer-events: none; }
.btn-small { background: var(--primary); color: white; border: none; padding: 6px 12px; border-radius: 8px; font-weight: 600; cursor: pointer;}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}