:root {
    --primary: #6366f1; --primary-dark: #4338ca; --bg-color: #F8FAFC;
    --card-bg: #FFFFFF; --text-dark: #1e293b; --text-muted: #64748b;
    --success: #10b981; --danger: #ef4444; --warning: #f59e0b;
}

body {
    font-family: 'Poppins', sans-serif; background-color: #e2e8f0;
    margin: 0; padding: 0; color: var(--text-dark);
    -webkit-tap-highlight-color: transparent; min-height: 100vh;
    display: flex; justify-content: center;
}

.app-container {
    width: 100%; max-width: 600px; background-color: var(--bg-color);
    min-height: 100vh; position: relative; box-shadow: 0 0 20px rgba(0,0,0,0.1);
    transition: background-color 0.3s, color 0.3s;
}

.header-container {
    background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
    padding: 15px 15px 30px 15px; border-bottom-left-radius: 30px; border-bottom-right-radius: 30px;
    color: white; box-shadow: 0 10px 25px -5px rgba(79, 70, 229, 0.4);
    position: sticky; top: 0; z-index: 10;
}

.month-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.nav-btn { background: rgba(255,255,255,0.2); border: none; color: white; width: 35px; height: 35px; border-radius: 50%; cursor: pointer; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.current-month { font-size: 1.1rem; font-weight: 600; text-transform: capitalize; }
.app-brand { text-align: center; font-size: 0.9rem; letter-spacing: 3px; font-weight: 800; text-transform: uppercase; color: rgba(255,255,255,0.9); margin-bottom: 15px; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-card { background: linear-gradient(145deg, rgba(255,255,255,0.15), rgba(255,255,255,0.05)); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 16px; padding: 15px 10px; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.3); }
.mini-card:active { transform: scale(0.98); }
.mini-label { font-size: 0.65rem; text-transform: uppercase; margin-bottom: 4px; opacity: 0.9; font-weight: 600; letter-spacing: 0.5px; }
.mini-amount { font-size: 1rem; font-weight: 700; white-space: nowrap; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.success-text { color: #86efac; } .danger-text { color: #fca5a5; }
.projection-card { background: rgba(0, 0, 0, 0.2); border: 1px dashed rgba(255, 255, 255, 0.3); }
.projection-card .mini-amount { color: #bfdbfe; }
.mini-card.highlight { background: #FFFFFF; color: var(--text-dark); border: none; box-shadow: 0 10px 20px rgba(0,0,0,0.2); transform: scale(1.02); z-index: 2; }
.mini-card.highlight .mini-label { color: var(--text-muted); opacity: 1; }
.mini-card.highlight .mini-amount { color: var(--primary); font-size: 1.4rem; text-shadow: none; }

.section-header { padding: 25px 20px 10px 20px; }
.section-title { font-size: 1rem; font-weight: 700; }
.section-subtitle { font-size: 0.75rem; color: var(--text-muted); }
.list-container { padding: 0 15px; }

.expense-card { background: var(--card-bg); border-radius: 14px; padding: 12px 15px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 5px rgba(0,0,0,0.03); border: 1px solid #f1f5f9; transition: 0.2s; overflow: hidden; }
.card-main-click { display: flex; align-items: center; gap: 12px; flex: 1; cursor: pointer; }
.icon-circle { width: 38px; height: 38px; background: #f1f5f9; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 1.1rem; }
.info h4 { margin: 0; font-size: 0.9rem; font-weight: 600; }

.date-small { font-size: 0.7rem; color: #94a3b8; display: inline-block; }
.date-badge { font-size: 0.7rem; background: #f1f5f9; padding: 1px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 4px; margin-top: 3px; }
.alert-urgent { color: var(--danger); background: #fef2f2; border: 1px solid #fecaca; font-weight: 600; }
.alert-soon { color: var(--warning); background: #fffbeb; border: 1px solid #fde68a; font-weight: 600; }

/* COLORES ETIQUETAS MÉTODOS V2.4 */
.metodo-badge { font-size: 0.6rem; padding: 2px 6px; border-radius: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.metodo-web { background: #e0e7ff; color: #4338ca; }
.metodo-app { background: #cffafe; color: #0891b2; }
.metodo-pac { background: #dcfce7; color: #15803d; }
.metodo-tc  { background: #fef08a; color: #a16207; }
.metodo-td  { background: #ffedd5; color: #c2410c; }
.metodo-transferencia { background: #f3e8ff; color: #7e22ce; }
.metodo-efectivo { background: #f3f4f6; color: #4b5563; }

.notification-banner { background: #fef2f2; color: var(--danger); padding: 10px 20px; margin: 15px; border-radius: 10px; border: 1px solid #fecaca; display: flex; align-items: center; gap: 10px; font-size: 0.9rem; font-weight: 600; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.amount-box { font-weight: 700; font-size: 0.9rem; margin-right: 10px; }
.btn-edit-icon { width: 30px; height: 30px; border-radius: 50%; border: none; background: transparent; color: #cbd5e1; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; }

.expense-card.pagado { background: #d1fae5; border-color: #10b981; }
.expense-card.pagado .icon-circle { background: #10b981; color: white; }
.expense-card.pagado .info h4 { text-decoration: line-through; color: #065f46; }
.expense-card.pagado .amount-box { color: #065f46; }

.app-credits { text-align: center; margin-top: 40px; padding: 20px; border-top: 1px dashed #e2e8f0; }
.app-credits p { margin: 5px 0; font-size: 0.75rem; color: var(--text-muted); }
.app-credits strong { color: var(--primary); font-weight: 600; }

.app-modal { border: none; border-radius: 20px; padding: 25px; width: 90%; max-width: 400px; margin: auto; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
.app-modal::backdrop { background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.app-modal form label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; color: var(--text-muted); }
.app-modal form input, .app-modal form select { width: 100%; padding: 12px; margin-bottom: 15px; border: 1px solid #e2e8f0; border-radius: 10px; font-family: inherit; font-size: 1rem; box-sizing: border-box; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions { display: flex; gap: 10px; margin-top: 10px; }
.btn-primary { background: var(--primary); color: white; border: none; padding: 12px; border-radius: 10px; font-weight: 600; width: 100%; cursor: pointer; }
.btn-secondary { background: #e2e8f0; color: var(--text-dark); border: none; padding: 12px; border-radius: 10px; font-weight: 600; width: 100%; cursor: pointer; }
.btn-danger { background: #fee2e2; color: var(--danger); border: none; padding: 12px; border-radius: 10px; font-weight: 600; width: 100%; cursor: pointer; }
.btn-secondary-small { background: transparent; border: 1px dashed #cbd5e1; color: var(--text-muted); width: 100%; padding: 8px; border-radius: 8px; cursor: pointer; margin-top: 5px;}
.ingreso-row { display: grid; grid-template-columns: 1.5fr 1fr 30px; gap: 8px; align-items: center; margin-bottom: 8px; }
.ingreso-row input { margin-bottom: 0 !important; padding: 8px !important; }
.btn-remove-ingreso { color: var(--danger); background: none; border: none; font-size: 1.2rem; cursor: pointer; }
.fab { position: absolute; bottom: 25px; right: 25px; width: 55px; height: 55px; background: var(--text-dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.5rem; box-shadow: 0 5px 15px rgba(0,0,0,0.3); cursor: pointer; z-index: 100; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }

/* MODO OSCURO PARA LOS NUEVOS BADGES */
@media (prefers-color-scheme: dark) {
    body { background-color: #000000; }
    .app-container { background-color: #0f172a; box-shadow: none; }
    :root { --bg-color: #0f172a; --card-bg: #1e293b; --text-dark: #f8fafc; --text-muted: #94a3b8; }
    .expense-card { border: 1px solid #334155; box-shadow: none; }
    .icon-circle { background: #334155; color: #cbd5e1; }
    .app-credits { border-top: 1px dashed #334155; }
    .app-modal { background-color: #1e293b; color: #f8fafc; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5); }
    .app-modal form input, .app-modal form select { background-color: #0f172a; border-color: #334155; color: white; }
    .btn-secondary { background: #334155; color: white; }
    .date-badge { background: #334155; color: #e2e8f0; }
    .alert-urgent { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
    .alert-soon { background: #422006; border-color: #78350f; color: #fcd34d; }
    .notification-banner { background: #450a0a; border-color: #7f1d1d; color: #fca5a5; }
    .mini-card.highlight { background: #1e293b; color: white; border: 1px solid #334155; }
    .mini-card.highlight .mini-amount { color: #818cf8; }

    .metodo-web { background: rgba(67, 56, 202, 0.3); color: #818cf8; border: 1px solid #4338ca; }
    .metodo-app { background: rgba(8, 145, 178, 0.3); color: #22d3ee; border: 1px solid #0891b2; }
    .metodo-pac { background: rgba(21, 128, 61, 0.3); color: #4ade80; border: 1px solid #15803d; }
    .metodo-tc  { background: rgba(161, 98, 7, 0.3); color: #facc15; border: 1px solid #a16207; }
    .metodo-td  { background: rgba(194, 65, 12, 0.3); color: #fdba74; border: 1px solid #c2410c; }
    .metodo-transferencia { background: rgba(126, 34, 206, 0.3); color: #d8b4fe; border: 1px solid #7e22ce; }
    .metodo-efectivo { background: rgba(75, 85, 99, 0.3); color: #9ca3af; border: 1px solid #4b5563; }
}