:root {
    --bg-color: #f2f2f7;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-color: #000;
    --text-muted: #666;
    --accent: #007AFF;
    --danger: #ff3b30;
    --border: rgba(0, 0, 0, 0.1);
    --input-bg: #fff;
    --overlay: rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1c1c1e;
        --card-bg: rgba(30, 30, 30, 0.65);
        --text-color: #fff;
        --text-muted: #98989d;
        --accent: #0a84ff;
        --border: rgba(255, 255, 255, 0.15);
        --input-bg: rgba(0,0,0,0.3);
        --overlay: rgba(0,0,0,0.7);
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg-color); color: var(--text-color); padding: 20px; padding-bottom: 80px; }

/* Glassmorphism */
.glass {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.container { max-width: 600px; margin: 0 auto; }

/* Header Clean */
.header-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
h1 { font-size: 1.4rem; font-weight: 700; }

/* Botones Circulares (Moneda y Ajustes) */
.circle-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--card-bg); color: var(--accent);
    border: 1px solid var(--border); cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.2rem; font-weight: bold; padding: 0; margin: 0;
    transition: transform 0.2s;
}
.circle-btn:active { transform: scale(0.9); }
.settings-icon svg { width: 22px; height: 22px; }

.summary { text-align: center; padding: 20px; margin-bottom: 25px; }
.summary span { font-size: 2rem; font-weight: 800; display: block; color: var(--accent); margin-top: 5px; }

/* Formulario */
label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; margin-top: 12px; }
input, button { width: 100%; display: block; padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--input-bg); color: var(--text-color); font-size: 16px; appearance: none; }
input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.row { display: flex; gap: 10px; }
.form-group { flex: 1; }

button { background: var(--accent); color: white; border: none; font-weight: 600; cursor: pointer; margin-top: 20px; }
button.secondary { background: var(--text-muted); margin-top: 10px; }

/* Modal Styles */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--overlay); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(5px);
}
.modal-content { width: 90%; max-width: 400px; padding: 20px; animation: popUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.close-icon { background: none; color: var(--text-color); font-size: 2rem; border: none; width: auto; padding: 0; margin: 0; cursor: pointer; }
.menu-btn { background: var(--card-bg); color: var(--accent); border: 1px solid var(--border); margin-top: 10px; text-align: left; }
.upload-label { display: block; text-align: center; cursor: pointer; }

/* Lista */
.tools { margin: 25px 0 10px; }
.expense-list { list-style: none; }
.expense-list li { padding: 15px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.item-info h3 { font-size: 1rem; margin-bottom: 2px; }
.item-info p { font-size: 0.85rem; color: var(--text-muted); font-style: italic; }
.item-amt { font-weight: 700; font-size: 1.1rem; font-family: monospace; text-align: right; }
.btn-act { background: none; border: none; width: auto; padding: 5px; font-size: 1.1rem; color: var(--text-muted); margin-left: 8px; }
.btn-act.del { color: var(--danger); }

/* Utilidades */
.hidden { display: none !important; }
@keyframes popUp { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: #2c2c2e; color: white; padding: 12px 24px; border-radius: 25px; z-index: 2000; }
#pwa-update { position: fixed; top: 0; left: 0; width: 100%; background: var(--accent); color: white; padding: 10px; display: flex; justify-content: space-between; z-index: 2000; }
#pwa-update button { width: auto; margin: 0; padding: 5px 10px; background: white; color: var(--accent); }
