/* --- Efecto glassmorphism y badges premium en cabecero --- */
.cabecero {
    background: linear-gradient(100deg, var(--color-cabecera, #9c3975) 60%, #dc2430 100%);
    box-shadow: 0 8px 32px 0 rgba(156,57,117,0.13);
    border-radius: 0 0 40px 40px;
    padding-top: 90px;
    padding-bottom: 50px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cabecero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: inherit;
    filter: blur(8px) brightness(1.08);
    opacity: 0.7;
    z-index: 0;
}
.presupuesto {
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,0.22);
    border-radius: 28px;
    box-shadow: 0 8px 32px 0 rgba(156,57,117,0.10);
    padding: 38px 38px 28px 38px;
    color: #fff;
    min-width: 340px;
    max-width: 96vw;
    text-align: center;
    backdrop-filter: blur(6px) saturate(1.2);
    border: 1.5px solid rgba(255,255,255,0.18);
}
.presupuesto_logo {
    color: var(--color-principal, #9c3975);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px #fff4;
}
.presupuesto_titulo {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 12px;
    letter-spacing: 1.2px;
    color: #fff;
    text-shadow: 0 2px 8px #9c3975a0;
}
.presupuesto_valor {
    font-weight: 800;
    font-size: 2.9rem;
    text-align: center;
    margin-bottom: 32px;
    letter-spacing: 2.5px;
    color: #fff;
    text-shadow: 0 2px 12px #9c3975a0;
    filter: drop-shadow(0 2px 8px #fff6);
    animation: balanceFadeIn 1.2s cubic-bezier(.4,1.4,.6,1) 1;
}
@keyframes balanceFadeIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: none; }
}
.presupuesto_ingreso, .presupuesto_egreso {
    padding: 16px 22px;
    border-radius: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.12rem;
    box-shadow: 0 2px 12px 0 rgba(40,185,181,0.09);
    background: rgba(255,255,255,0.38);
    border: 1.5px solid rgba(255,255,255,0.18);
    color: #222 !important;
}
.presupuesto_ingreso--texto, .presupuesto_egreso--texto {
    font-weight: 700;
    font-size: 1.12rem;
    letter-spacing: 0.7px;
    color: #222 !important;
}
.presupuesto_ingreso--valor, .presupuesto_egreso--valor {
    font-weight: 800;
    font-size: 1.12rem;
    margin-right: 12px;
    color: #222 !important;
}
.presupuesto_ingreso--porcentaje, .presupuesto_egreso--porcentaje {
    display: inline-block;
    min-width: 54px;
    padding: 5px 14px;
    font-size: 1.08em;
    font-weight: 800;
    border-radius: 18px;
    background: linear-gradient(90deg, var(--color-secundario, #e6faf9) 60%, #fff 100%);
    color: var(--color-principal, #9c3975);
    box-shadow: 0 2px 8px 0 rgba(40,185,181,0.09);
    margin-left: 12px;
    letter-spacing: 0.7px;
    vertical-align: middle;
    border: 1.5px solid var(--color-principal, #9c3975);
    transition: background 0.2s, color 0.2s, border 0.2s;
    cursor: help;
    filter: drop-shadow(0 2px 8px #fff6);
}
.presupuesto_egreso--porcentaje {
    background: linear-gradient(90deg, #ffdada 60%, #fff 100%);
    color: #dc2430;
    border: 1.5px solid #dc2430;
}
.presupuesto_ingreso--porcentaje[title]:hover, .presupuesto_egreso--porcentaje[title]:hover {
    filter: brightness(1.1) drop-shadow(0 2px 12px #9c397540);
    background: #fffbe6;
}
/* Estadísticas visuales en cabecero */
.presupuesto_ingreso--porcentaje, .presupuesto_egreso--porcentaje {
    display: inline-block;
    min-width: 48px;
    padding: 4px 10px;
    font-size: 1.05em;
    font-weight: 700;
    border-radius: 16px;
    background: var(--color-secundario, #e6faf9);
    color: var(--color-principal, #28B9B5);
    box-shadow: 0 1px 4px 0 rgba(40,185,181,0.09);
    margin-left: 10px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    transition: background 0.2s, color 0.2s;
    cursor: help;
}
.presupuesto_egreso--porcentaje {
    background: #ffdada;
    color: #dc2430;
}
.presupuesto_ingreso--porcentaje[title]:hover, .presupuesto_egreso--porcentaje[title]:hover {
    filter: brightness(1.1) drop-shadow(0 2px 8px #9c397540);
}
.presupuesto_ingreso, .presupuesto_egreso {
    color: #222 !important;
}
.presupuesto_ingreso--texto, .presupuesto_egreso--texto,
.presupuesto_ingreso--valor, .presupuesto_egreso--valor {
    color: #222 !important;
}
/* Variables de tema dinámico */
:root {
    --color-principal: #28B9B5;
    --color-secundario: #e6faf9;
    --color-cabecera: #28B9B5;
    --color-btn: #28B9B5;
    --color-contraste: #fff;
}
body {
    background: linear-gradient(120deg, var(--color-secundario) 0%, #f4f6fb 60%, #e6faf9 100%);
}
.cabecero {
    background: linear-gradient(100deg, var(--color-cabecera) 60%, #dc2430 100%);
}
.presupuesto_logo {
    color: var(--color-principal);
}
.presupuesto_ingreso {
    background: linear-gradient(90deg, var(--color-secundario) 60%, #e6faf9 100%);
    color: var(--color-principal);
}
.presupuesto_egreso {
    background: linear-gradient(90deg, #fff0f0 60%, #ffdada 100%);
    color: #dc2430;
}
.ingreso_titulo, .egreso_titulo {
    border-left: 6px solid var(--color-principal);
}
.egreso_titulo {
    border-left: 6px solid #dc2430;
}
.agregar_btn {
    background: var(--color-btn);
}
.resumen_btn {
    background: var(--color-principal);
}
/* Selector de moneda y mejor contraste de tipografía */
.agregar_moneda {
    width: 110px;
    border: 1.5px solid #e7e7e7;
    height: 44px;
    font-size: 1.08rem;
    color: #222;
    background-color: #f7f7f7;
    font-weight: 700;
    border-radius: 6px;
    transition: border 0.3s;
    margin-right: 8px;
    outline: none;
}
.agregar_moneda:focus {
    border: 1.5px solid #28B9B5;
}

body, .presupuesto, .contenedor, .ingreso, .egreso, .elemento, .presupuesto_titulo, .presupuesto_valor, .elemento_descripcion, .elemento_valor, .elemento_porcentaje, .agregar_tipo, .agregar_descripcion, .agregar_valor {
    font-family: 'Open Sans', Arial, sans-serif !important;
    color: #222 !important;
    font-weight: 700 !important;
    letter-spacing: 0.2px;
}
/* --- REDISEÑO ELEGANTE Y MODERNO --- */
body {
    background: linear-gradient(120deg, #e0e7ff 0%, #f4f6fb 60%, #e6faf9 100%);
    font-family: 'Open Sans', Arial, sans-serif;
    color: #222;
    min-height: 100vh;
}

.cabecero {
    min-height: 38vh;
    background: linear-gradient(100deg, #7b4397 60%, #dc2430 100%);
    box-shadow: 0 8px 32px 0 rgba(123,67,151,0.13);
    border-radius: 0 0 32px 32px;
    padding-top: 80px;
    padding-bottom: 40px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.presupuesto {
    background: rgba(255,255,255,0.13);
    border-radius: 24px;
    box-shadow: 0 4px 24px 0 rgba(123,67,151,0.10);
    padding: 32px 32px 24px 32px;
    color: #fff;
    min-width: 340px;
    max-width: 96vw;
    text-align: center;
}
.presupuesto_logo {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.presupuesto_titulo {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 10px;
    letter-spacing: 1px;
}
.presupuesto_valor {
    font-weight: 700;
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 2px 8px #7b4397a0;
}
.presupuesto_ingreso, .presupuesto_egreso {
    padding: 14px 18px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.08rem;
    box-shadow: 0 1px 8px 0 rgba(40,185,181,0.09);
}
.presupuesto_ingreso {
    background: linear-gradient(90deg, #e6faf9 60%, #b2f7ef 100%);
    color: #28B9B5;
}
.presupuesto_egreso {
    background: linear-gradient(90deg, #fff0f0 60%, #ffdada 100%);
    color: #FF5049;
}
.presupuesto_ingreso--texto, .presupuesto_egreso--texto {
    font-weight: 700;
    font-size: 1.08rem;
    letter-spacing: 0.5px;
}
.presupuesto_ingreso--valor, .presupuesto_egreso--valor {
    font-weight: 700;
    font-size: 1.08rem;
    margin-right: 10px;
}
.presupuesto_ingreso--porcentaje, .presupuesto_egreso--porcentaje {
    font-size: 0.98rem;
    background: #fff;
    color: #222;
    border-radius: 6px;
    padding: 2px 8px;
    margin-left: 8px;
    min-width: 38px;
    text-align: center;
    font-weight: 600;
}

.contenedor {
    width: 1200px;
    max-width: 98vw;
    margin: 60px auto 60px auto;
    background: rgba(255,255,255,0.98);
    border-radius: 32px;
    box-shadow: 0 8px 40px 0 rgba(40,185,181,0.13), 0 1.5px 8px 0 rgba(123,67,151,0.07);
    padding: 48px 40px 56px 40px;
    border: 1.5px solid #e6faf9;
    display: flex;
    gap: 3vw;
    flex-wrap: wrap;
    justify-content: space-between;
}
.ingreso, .egreso {
    flex: 1 1 45%;
    min-width: 340px;
    background: rgba(230,250,249,0.7);
    border-radius: 18px;
    box-shadow: 0 2px 12px 0 #28b9b51a;
    padding: 32px 24px 32px 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.egreso {
    background: rgba(255,240,240,0.7);
    box-shadow: 0 2px 12px 0 #ff50491a;
}
.ingreso_titulo, .egreso_titulo {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 22px;
    letter-spacing: 1px;
    padding-left: 8px;
    border-left: 6px solid #28B9B5;
    background: none;
    box-shadow: none;
}
.egreso_titulo {
    border-left: 6px solid #FF5049;
}
.elemento {
    padding: 18px 24px;
    border-bottom: 1.5px solid #e7e7e7;
    border-radius: 14px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px 0 rgba(40,185,181,0.09);
    transition: box-shadow 0.2s, background 0.2s;
    background: #f9f9f9;
    font-size: 1.08rem;
}
.elemento_descripcion {
    font-weight: 700;
    font-size: 1.08rem;
    flex: 1 1 60%;
    color: #222;
    letter-spacing: 0.5px;
}
.elemento_valor {
    font-weight: 700;
    font-size: 1.08rem;
    margin-right: 18px;
    letter-spacing: 0.5px;
}
.elemento_porcentaje {
    margin-left: 18px;
    font-size: 13px;
    background-color: #FFDAD9;
    padding: 6px 12px;
    border-radius: 8px;
    min-width: 48px;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.elemento_eliminar {
    display: flex;
    align-items: center;
    height: 100%;
}
.elemento_eliminar--btn {
    font-size: 24px;
    background: #fff;
    border: 2px solid #e7e7e7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    margin-left: 12px;
    box-shadow: 0 2px 8px 0 rgba(40,185,181,0.09);
    transition: background 0.2s, border 0.2s;
    color: #FF5049;
    opacity: 0.92;
}
.elemento_eliminar--btn:hover {
    background: #FF5049;
    color: #fff;
    border: 2px solid #FF5049;
    opacity: 1;
    box-shadow: 0 4px 16px 0 #ff50491a;
}
.elemento:hover .elemento_valor { transform: translateX(-10px); color: #222; }
.elemento:hover .elemento_porcentaje { transform: translateX(-10px); background: #ffbdbd; }

@media (max-width: 1300px) {
    .contenedor {
        width: 98vw;
        padding: 8px 2vw 24px 2vw;
        flex-direction: column;
        gap: 0;
    }
    .ingreso, .egreso {
        width: 98vw;
        float: none;
        margin: 0 0 24px 0;
        min-width: unset;
        padding: 18px 6vw 18px 6vw;
    }
}
@media (max-width: 900px) {
    .contenedor {
        width: 98vw;
        padding: 8px 2vw 24px 2vw;
        flex-direction: column;
        gap: 0;
    }
    .ingreso, .egreso {
        width: 98vw;
        float: none;
        margin: 0 0 24px 0;
        min-width: unset;
        padding: 18px 4vw 18px 4vw;
    }
}
@media (max-width: 600px) {
    .presupuesto {
        width: 95vw;
        padding: 12px 2vw 12px 2vw;
    }
    .cabecero {
        padding-top: 40px;
        padding-bottom: 20px;
    }
    .agregar_contenedor {
        flex-direction: column;
        gap: 6px;
    }
    .agregar_descripcion, .agregar_valor, .agregar_tipo {
        width: 95vw;
        max-width: 95vw;
    }
    .contenedor {
        padding: 4px 1vw 12px 1vw;
    }
    .ingreso, .egreso {
        padding: 12px 2vw 12px 2vw;
    }
}
/* Modernos campos de formulario */
.agregar_descripcion, .agregar_valor {
    border: 1px solid #e7e7e7;
    background-color: #fff;
    color: #333;
    font-family: inherit;
    font-size: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    transition: border 0.3s;
    outline: none;
}
.agregar_descripcion { width: 220px; max-width: 90vw;}
.agregar_valor { width: 110px;}

/* Botones modernos */
.agregar_btn {
    font-size: 28px;
    background: #28B9B5;
    border: none;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    margin-left: 0;
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px 0 rgba(40,185,181,0.13);
}
.agregar_btn:active { transform: scale(0.96); }
.limpiar_btn { background: #FF5049; }
.resumen_btn { background: #7b4397; }
.agregar_btn:hover { filter: brightness(1.1); }

/* Modal resumen */
.modal_resumen {
    position: fixed;
    z-index: 1000;
    left: 0; top: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal_contenido {
    background: #fff;
    border-radius: 12px;
    padding: 32px 24px 24px 24px;
    min-width: 300px;
    max-width: 90vw;
    box-shadow: 0 4px 24px 0 rgba(123,67,151,0.13);
    position: relative;
}
.modal_cerrar {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 2rem;
    color: #dc2430;
    cursor: pointer;
}

@media (max-width: 900px) {
    .contenedor {
        width: 98vw;
        padding: 8px 2vw 24px 2vw;
    }
    .ingreso, .egreso {
        width: 98vw;
        float: none;
        margin: 0 0 24px 0;
        min-width: unset;
    }
}
@media (max-width: 600px) {
    .presupuesto {
        width: 95vw;
        padding: 12px 2vw 12px 2vw;
    }
    .cabecero {
        padding-top: 60px;
        padding-bottom: 30px;
    }
    .agregar_contenedor {
        flex-direction: column;
        gap: 6px;
    }
    .agregar_descripcion, .agregar_valor, .agregar_tipo {
        width: 95vw;
        max-width: 95vw;
    }
    .contenedor {
        padding: 4px 1vw 12px 1vw;
    }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.limpiarEstilos::after {
    content: "";
    display: table;
    clear: both;
}

body {
    color: #555;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 16px;
    position: relative;
    min-height: 100vh;
    font-weight: 400;
    background: #f4f6fb;
}

.derecha { float: right; }
.rojo { color: #FF5049 !important; }
.rojofocus:focus { border: 1px solid #FF5049 !important; }

.cabecero {
    min-height: 40vh;
    background-size: cover;
    background-position: center;
    position: relative;
    width: 100%;
    padding-top: 120px;
    padding-bottom: 60px;
    color: #fff;
    background: url(fondo.png), linear-gradient(to left, #7b4397, #dc2430);
    box-shadow: 0 4px 16px 0 rgba(123,67,151,0.15);
}
.presupuesto_logo {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.presupuesto {
    position: absolute;
    width: 350px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    background: rgba(255,255,255,0.08);
    border-radius: 18px;
    box-shadow: 0 2px 12px 0 rgba(0,0,0,0.08);
    padding: 24px 18px 18px 18px;
}

.presupuesto_titulo{
    font-size: 20px;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 300;
}

.presupuesto_valor {
    font-weight: 300;
    font-size: 46px;
    text-align: center;
    margin-bottom: 25px;
    letter-spacing: 2px;
}

.presupuesto_ingreso,
.presupuesto_egreso {
    padding: 12px;
    text-transform: uppercase;
}

.presupuesto_ingreso {
    margin-bottom: 10px;
    background-color: #28B9B5;
}

.presupuesto_egreso {
    background-color: #FF5049;
}

.presupuesto_ingreso--texto,
.presupuesto_egreso--texto {
    float: left;
    font-size: 13px;
    color: #fff;
    margin-top: 2px;
}

.presupuesto_ingreso--valor,
.presupuesto_egreso--valor {
    letter-spacing: 1px;
    float: left;
}

.presupuesto_ingreso--porcentaje,
.presupuesto_egreso--porcentaje {
    float: left;
    width: 34px;
    font-size: 11px;
    padding: 3px 0;
    margin-left: 10px;
}

.presupuesto_egreso--porcentaje {
    background-color: rgba(255, 255, 255, 0.2);
    text-align: center;
    border-radius: 3px;
}


.agregar {
    padding: 14px;
    border-bottom: 1px solid #e7e7e7;
    background-color: #f7f7f7;
}

.agregar_btn:active { transform: translateY(2px); }

.agregar_descripcion { width: 400px;}
.agregar_valor { width: 100px;}

.agregar_btn {
    font-size: 35px;
    background: none;
    border: none;
    color: #28B9B5;
    cursor: pointer;
    display: inline-block;
    vertical-align: middle;
    line-height: 1.1;
    margin-left: 10px;
}

.agregar_btn:active { transform: translateY(2px); }

.agregar_tipo:focus,
.agregar_descripcion:focus,
.agregar_valor:focus {
    outline: none;
    border: 1px solid #28B9B5;
}

.agregar_btn:focus { outline: none; }

.contenedor {
    width: 860px;
    margin: 60px auto;
}

.ingreso {
    float: left;
    width: 370px;
    margin-right: 70px;
}

.egreso {
    float: left;
    width: 370px;
}

h2 {
    text-transform: uppercase;
    font-size: 18px;
    font-weight: 400;
    margin-bottom: 15px;
}

.ingreso_titulo { color: #28B9B5; }
.ingreso_titulo {
    color: #28B9B5;
    background: #e6faf9;
    border-radius: 8px;
    padding: 8px 0 8px 16px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px 0 #28b9b51a;
}
.egreso_titulo {
    color: #FF5049;
    background: #fff0f0;
    border-radius: 8px;
    padding: 8px 0 8px 16px;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px 0 #ff50491a;
}

.elemento {
    padding: 13px 16px;
    border-bottom: 1px solid #e7e7e7;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 1px 4px 0 rgba(40,185,181,0.07);
    transition: box-shadow 0.2s, background 0.2s;
    background: #f9f9f9;
}

.elemento:first-child { border-top: 1px solid #e7e7e7; }
.elemento:nth-child(even) { background-color: #f7f7f7; }

.elemento_descripcion {
    float: left;
    font-weight: 600;
    font-size: 1rem;
    flex: 1 1 60%;
    color: #333;
}

.elemento_valor {
    float: left;
    font-weight: 600;
    font-size: 1rem;
    margin-right: 12px;
    transition: transform 0.3s, color 0.2s;
}

.elemento_porcentaje {
    float: left;
    margin-left: 16px;
    transition: transform 0.3s, background 0.2s;
    font-size: 12px;
    background-color: #FFDAD9;
    padding: 4px 8px;
    border-radius: 6px;
    width: auto;
    min-width: 45px;
    text-align: center;
    font-weight: 600;
}

.ingreso .elemento_valor,
.ingreso .elemento_eliminar--btn {
    color: #28B9B5;
}

.egreso .elemento_valor,
.egreso .elemento_porcentaje,
.egreso .elemento_eliminar--btn {
    color: #FF5049;
}


.elemento_eliminar {
    float: left;
    display: flex;
    align-items: center;
    height: 100%;
}

.elemento_eliminar--btn {
    font-size: 24px;
    background: #fff;
    border: 2px solid #e7e7e7;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    margin-left: 12px;
    box-shadow: 0 2px 8px 0 rgba(40,185,181,0.09);
    transition: background 0.2s, border 0.2s;
    color: #FF5049;
    opacity: 0.92;
}
.elemento_eliminar--btn:hover {
    background: #FF5049;
    color: #fff;
    border: 1.5px solid #FF5049;
    opacity: 1;
}
}

.elemento_eliminar--btn:focus { outline: none; }
.elemento_eliminar--btn:active { transform: translateY(2px); }

.elemento:hover .elemento_eliminar--btn { display: block; }
.elemento:hover .elemento_valor { transform: translateX(-10px); color: #222; }
.elemento:hover .elemento_porcentaje { transform: translateX(-10px); background: #ffbdbd; }
