* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f8;
    color: #222;
}

button,
input,
select,
textarea {
    appearance: none;
    -webkit-appearance: none;
    border-radius: 12px;
}

.app-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    padding: 16px 14px 28px 14px;
    box-sizing: border-box;
}

.app-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    box-sizing: border-box;
    width: 100%;
}

.app-header {
    background: #4f46e5;
    color: white;
    padding: 18px 20px;
    text-align: center;
}

.app-header h1 {
    margin: 0;
    font-size: 24px;
}

.saldo {
    font-size: 38px;
    font-weight: bold;
    margin: 10px 0;
}

.btn {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 14px;
    border: none;
    background: #4f46e5;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.btn-secondary {
    background: #64748b;
}

.btn-danger {
    background: #dc2626;
}

.btn-success {
    background: #16a34a;
}

.btn-warning {
    background: #f59e0b;
    color: #222;
}

input,
select,
textarea {
    width: 100%;
    padding: 13px;
    border: 1px solid #ccc;
    font-size: 16px;
    margin-bottom: 14px;
    background: white;
    color: #222;
}

.estado-pendiente {
    color: #f59e0b;
    font-weight: bold;
}

.estado-aceptado,
.estado-pagado,
.estado-aplicado {
    color: #16a34a;
    font-weight: bold;
}

.estado-rechazado {
    color: #dc2626;
    font-weight: bold;
}

/* HISTORIAL */

.historial-item {
    border-left: 6px solid #cbd5e1 !important;
}

.historial-ingreso {
    border-left-color: #16a34a !important;
}

.historial-multa {
    border-left-color: #dc2626 !important;
}

.historial-cobro {
    border-left-color: #2563eb !important;
}

.historial-pendiente {
    border-left-color: #f59e0b !important;
}

.badge {
    display: inline-block !important;
    padding: 6px 10px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
    font-weight: bold !important;
}

.badge-pendiente {
    background-color: #fef3c7 !important;
    color: #92400e !important;
}

.badge-aceptado,
.badge-pagado,
.badge-aplicado {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.badge-rechazado {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.importe-positivo {
    color: #16a34a !important;
}

.importe-negativo {
    color: #dc2626 !important;
}

.importe-neutro {
    color: #334155 !important;
}

.movimiento-meta {
    color: #64748b !important;
    font-size: 14px !important;
}

@media (max-width: 480px) {

    .app-container {
        padding: 14px;
    }

    .saldo {
        font-size: 34px;
    }

    .app-card {
        padding: 16px;
    }

    .btn {
        font-size: 15px;
        padding: 13px;
    }
}

.alerta {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 16px;
    font-weight: 600;
    box-shadow: 0 8px 22px rgba(0,0,0,0.12);
    border-left: 6px solid #64748b;
    animation: aparecerAlerta 0.25s ease-out;
}

.alerta-exito {
    border-left-color: #16a34a;
    background: #f0fdf4;
    color: #166534;
}

.alerta-error {
    border-left-color: #dc2626;
    background: #fef2f2;
    color: #991b1b;
}

.alerta-info {
    border-left-color: #2563eb;
    background: #eff6ff;
    color: #1e40af;
}

.alerta-aviso {
    border-left-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

@keyframes aparecerAlerta {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    width: calc(100% - 28px);
    max-width: 680px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    z-index: 9999;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    animation: toastIn 0.35s ease forwards, toastOut 0.35s ease 2.2s forwards;
}

.toast-exito {
    border-left: 6px solid #22c55e;
    color: #166534;
}

.toast-error {
    border-left: 6px solid #ef4444;
    color: #991b1b;
}

.toast-aviso {
    border-left: 6px solid #f59e0b;
    color: #92400e;
}

.toast-info {
    border-left: 6px solid #3b82f6;
    color: #1d4ed8;
}

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.push-status {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #64748b;
}

.push-link {
    background: none;
    border: none;
    color: #4f46e5;
    font-size: 14px;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}