:root {
    --primary: #8b5cf6;
    --accent: #d8b4fe;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #e60000;
    --glass: rgba(111, 79, 255, 0.87);
    --glass-border: rgba(255, 255, 255, 0.3);
}

body {
    margin: 0;
    font-family: 'Sora', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: #1e293b;
    min-height: 100vh;
    display: flex;
    align-items: center; 
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
    box-sizing: border-box;
}

.bg-blur {
    position: fixed;
    width: 300px;
    height: 300px;
    background: var(--primary);
    filter: blur(120px);
    border-radius: 50%;
    z-index: -1;
    top: 10%;
    left: 10%;
    opacity: 0.4;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

h1 { font-size: 24px; margin: 0; font-weight: 700; color: #0f172a; }
#current-date { font-size: 14px; color: #64748b; margin: 5px 0 0; }

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: var(--success);
    color: white;
}

.main-card {
    background: #0f172a;
    color: white;
    padding: 25px;
    border-radius: 24px;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.balance-display .label { font-size: 13px; opacity: 0.7; }
.balance-display h2 { font-size: 32px; margin: 5px 0 20px; }

/* --- CORREÇÃO DAS JANELINHAS LADO A LADO --- */
.stats-grid {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
}

.stat-item {
    background: rgba(255,255,255,0.05);
    padding: 10px 5px;
    border-radius: 12px;
    flex: 1; /* Força as 3 caixas a terem o mesmo tamanho */
    text-align: center;
    min-width: 0;
}

.stat-item .label {
    font-size: 10px;
    opacity: 0.6;
    display: block;
    margin-bottom: 4px;
}

.stat-item p {
    margin: 0;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap; /* Impede de quebrar linha */
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-track {
    background: rgba(255,255,255,0.1);
    height: 10px;
    border-radius: 5px;
    margin-top: 8px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.glass-input-group {
    background: rgba(255,255,255,0.4);
    padding: 15px;
    border-radius: 20px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.glass-input-group h3 { font-size: 14px; margin: 0 0 10px; color: #475569; }

/* --- CORREÇÃO DA LINHA DE INPUTS --- */
.row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.row input {
    flex: 1;
    min-width: 0;
}

input {
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    padding: 12px;
    border-radius: 12px;
    font-family: inherit;
    margin-bottom: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

button {
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 15px #8b5cf6; }

.btn-glass{
    background: var(--primary);
    color: white;
    border: none;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
}

.btn-glass:hover{
    transform: translateY(-2px);
    box-shadow: 0 5px 15px  #8b5cf6;
}

#transaction-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#transaction-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    border-left: 4px solid #e74c3c;
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .app-container {
        padding: 20px 15px;
        border-radius: 20px;
        max-width: 100%;
    }

    h1 { font-size: 20px; }
    .balance-display h2 { font-size: 26px; }
    .main-card { padding: 18px; }
    .glass-input-group { padding: 12px; }
}

.btn-delete {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 4px;
    display: flex;
    align-items: center;
}

.btn-delete:hover { transform: scale(1.2); }
.btn-delete:active { transform: scale(0.9); }

.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    animation: popIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-icon { font-size: 40px; margin-bottom: 10px; }
.modal-content h3 { margin: 0; color: #1e293b; }
.modal-content p { color: #64748b; font-size: 14px; }

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    background: #e2e8f0;
    border: none; padding: 12px; border-radius: 12px;
    flex: 1;
    font-weight: 600; cursor: pointer;
}

.btn-confirm {
    background: var(--danger);
    color: white; border: none; padding: 12px; border-radius: 12px;
    flex: 1;
    font-weight: 600; cursor: pointer;
}

input:focus {
    outline: 2px solid var(--primary);
    background: white;
}

.btn-reset {
    background: #ff1100;
    color: white;
    border: 1px solid var(--danger);
    width: 100%;
    padding: 10px;
    border-radius: 12px;
    margin-top: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background-color: var(--danger);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--danger);
}

.toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #1e293b;
    color: #fff;
    text-align: center;
    border-radius: 12px;
    padding: 16px;
    position: fixed;
    z-index: 2000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    font-weight: 600;
    font-size: 14px;
    transition: visibility 0.3s, opacity 0.3s, bottom 0.3s;
    opacity: 0;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}
