
.pass-field {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 50px;
}

.pass-field input {
    width: 100%;
    height: 100%;
    padding-right: 46px;
}

.pass-field .pass-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    color: var(--textSecondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1;
}

.pass-field .pass-toggle:hover {
    background: var(--lightHover);
    color: var(--text);
}

.pass-field .pass-toggle svg {
    width: 20px;
    height: 20px;
}

/* --------------------------------------------
   NOTIFICACIONES
   -------------------------------------------- */

.notificaciones-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: min(460px, calc(100vw - 32px));
    pointer-events: none;
}

.notificacion {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 12px 18px;
    color: var(--text);
    border-radius: 30px;
    /* Velo + difuminado: la notificación flota sobre la app sin capa que la
       separe, así que necesita ambos para que el texto se lea. Los aporta
       .glass; aquí solo se fija el nivel, más tupido que el de las cards
       porque el texto va sobre el contenido borroso. */
    --blur-frosted: 14px;
    /* Color de acento por tipo: tiñe el ícono. Cada variante lo
       sobreescribe abajo. */
    --acento: var(--textSecondary);
    background-color: var(--glass-frosted);
    -webkit-backdrop-filter: blur(var(--blur-frosted));
    backdrop-filter: blur(var(--blur-frosted));
    opacity: 0;
    transform: translateY(-16px);
    transition: all 0.3s ease;
}

.notificacion:hover {
    --glow: inset 0 0 24px var(--shadow);
    border: 1px solid var(--border);
}

.notificacion.notificacion-activa {
    opacity: 1;
    transform: translateY(0);
}

.notificacion.notificacion-saliendo {
    opacity: 0;
    transform: translateY(20px);
}

.notificacion.notificacion-exito { --acento: var(--positive); }
.notificacion.notificacion-error { --acento: var(--negative); }
.notificacion.notificacion-info { --acento: var(--textSecondary); }
.notificacion.notificacion-warning { --acento: var(--ambarAlt); }

.notificacion-icono {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--acento);
}

.notificacion-mensaje {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
    min-width: 0;
}

.notificacion-cerrar {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--textSecondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notificacion-cerrar:hover {
    background: var(--lightHover);
    color: var(--text);
}

.notificacion-accion {
    flex-shrink: 0;
    padding: 5px 10px;
    border-radius: 30px;
    background: var(--surface);
    border: 1px solid var(--text);
    color: var(--text);
    font-size: 12px;
    font-family: var(--font-primary, inherit);
    cursor: pointer;
    transition: all 0.3s ease;
}

.notificacion-accion:hover {
    background: var(--lightHover);
    border-color: var(--border);
    color: var(--textAlt);
    box-shadow: inset 0 0 10px var(--shadow);
}

.notificacion-accion-primaria {
    background: var(--background);
    border-color: var(--border);
    color: var(--text);
}

.notificacion-accion-primaria:hover {
    background: var(--positive);
    border-color: var(--text);
    color: var(--textAlt);
}

.notificacion-accion.cancel {
    background: var(--background);
    border-color: var(--negative);
    color: var(--negative);
}

.notificacion-accion.cancel:hover {
    background: var(--negative);
    border-color: var(--text);
    color: var(--textAlt);
}

/* --------------------------------------------
   LASTRAR · ITEM PENDIENTES
   -------------------------------------------- */

.lastbar .item-pendientes {
    color: var(--text);
}

.lastbar .item-pendientes.activo svg {
    color: var(--positive);
}

/* --------------------------------------------
   PANEL HEADER
   -------------------------------------------- */

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
}

.panel-header h2 {
    color: var(--border);
    font-size: 28px;
    margin: 0;
    font-weight: 600;
}

/* --------------------------------------------
   TOTALES DEL FILTRO
   -------------------------------------------- */

.totales {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 8px 16px 0;
    font-size: 13px;
}

.totales-count {
    color: var(--textSecondary);
    font-weight: 500;
}

.totales-item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 50px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.totales-positivo {
    color: var(--positive);
    font-family: var(--font-secondary);
    font-weight: 600;
}

.totales-negativo {
    color: var(--negative);
    font-family: var(--font-secondary);
    font-weight: 600;
}

.totales-ganancia {
    color: var(--text);
    font-family: var(--font-secondary);
    font-weight: 600;
}

.totales-sep {
    color: var(--textSecondary);
}

.totales-divisa {
    color: var(--text);
    font-weight: 600;
}

/* Botones de acción dentro de la fila de totales */
.totales-acciones {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.totales-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--textSecondary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.totales-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: inset 0 0 8px var(--shadow);
}

/* --------------------------------------------
   LISTA DE CARDS
   -------------------------------------------- */

.lista-cards {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    padding: 4px;
    overflow-y: auto;
    overflow-x: hidden;
}

.lista-cards::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    pointer-events: none;
}

.card-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 40px;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.card-item:not(.seleccionado):hover {
    background: var(--lightHover);
    border-color: var(--text);
    box-shadow: inset 0 0 10px var(--shadow);
}

.card-item .card-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.card-item .card-item-titulo {
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-item .card-item-detalle {
    font-size: 12px;
    color: var(--textSecondary);
}

.card-item .card-item-etiquetas {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.card-item-valor {
    font-family: var(--font-secondary);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    margin-left: 12px;
    text-align: right;
}

.card-item-valor.positive {
    color: var(--positive);
}

.card-item-valor.negative {
    color: var(--negative);
}

.card-item-valor.ambar {
    color: var(--ambar);
}

.card-item.seleccionado {
    border-color: var(--text);
    background: var(--backgroundAlt);
    box-shadow: inset 0 0 0 1px var(--shadow);
}

.card-item.seleccionado .card-item-titulo {
    color: var(--textAlt);
}

.card-item.seleccionado .card-item-detalle {
    color: var(--surface);
}

.card-item.card-item.seleccionado .card-item-valor.positive {
    color: var(--positiveAlt);
}

.card-item.card-item.seleccionado .card-item-valor.negative {
    color: var(--negativeAlt);
}

/* --------------------------------------------
   FORMULARIO MOVIMIENTO · GRID
   -------------------------------------------- */

.form-movimiento-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-movimiento-grid .form-group.full {
    grid-column: 1 / -1;
}

@media (max-width: 520px) {
    .form-movimiento-grid {
        grid-template-columns: 1fr;
    }
}

/* --------------------------------------------
   HINT
   -------------------------------------------- */

.hint {
    font-size: 12px;
    color: var(--textSecondary);
    opacity: 0.7;
}

/* --------------------------------------------
   DESACTIVADO
   -------------------------------------------- */

.desact {
    opacity: 0.45;
    pointer-events: none;
}

/* --------------------------------------------
   SECCIONES DE PANEL
   -------------------------------------------- */

[data-panel-section] {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

[data-panel-section][data-hidden="true"] {
    display: none;
}

/* ---- desde style.css ---- */

/* ============================================
   LISTAS VACÍAS (reutilizable)
   ============================================ */

#panel {
    position: relative;
}

.lista-vacia {
    color: var(--textSecondary);
    text-align: center;
    padding: 40px 20px;
    margin: 0;
    font-size: 14px;
}

.lista-vacia.error {
    color: var(--negative);
    margin: auto;
}

.lista-vacia.error .btn-sm:hover {
    box-shadow: inset 0 0 10px var(--shadow);
}

.lista-vacia-hint {
    font-size: 13px;
    opacity: 0.7;
}

/* ============================================
   BOTONES COMPACTOS (lastbar, listas)
   ============================================ */

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 50px;
    cursor: pointer;
}

.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 50px;
    cursor: pointer;
}

.btn-danger {
    color: var(--negative);
}

.btn-danger:hover {
    background: var(--negative);
    color: var(--background);
}


/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes loading {
    0%   { transform: rotate(0deg); }
    15%  { transform: rotate(72deg); }
    20%  { transform: rotate(72deg); }
    35%  { transform: rotate(144deg); }
    40%  { transform: rotate(144deg); }
    55%  { transform: rotate(216deg); }
    60%  { transform: rotate(216deg); }
    75%  { transform: rotate(288deg); }
    80%  { transform: rotate(288deg); }
    95%  { transform: rotate(360deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shake {
    0%   { transform: translateY(0px); }
    10%  { transform: translateY(1px); }
    30%  { transform: translateY(-1px); }
    50%  { transform: translateY(1px); }
    70%  { transform: translateY(-1px); }
    90%  { transform: translateY(1px); }
    100% { transform: translateY(0px); }
}

/* ============================================
   PWA · BANNER DE ACTUALIZACIÓN
   ============================================ */

.pwa-update-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    --glow: 0 8px 32px var(--shadow);
    /* Sin difuminado: el banner ya lleva --surface opaco detrás, y un
       backdrop-filter detrás de un fondo opaco no se ve. */
    animation: slideUpBanner 0.3s ease;
}

.pwa-update-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    box-shadow: var(--glow, none);
    pointer-events: none;
}

.pwa-update-texto {
    color: var(--text);
    font-size: 13px;
    font-family: var(--font-primary);
}

.pwa-update-btn {
    padding: 6px 16px;
    border-radius: 50px;
    background: var(--positive);
    color: var(--onyx);
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pwa-update-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 230, 149, 0.3);
}

@keyframes slideUpBanner {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@media (max-width: 480px) {
    .pwa-update-banner {
        left: 12px;
        right: 12px;
        transform: none;
        animation: none;
    }
}
/* ============================================
   RESUMEN · CARDS DE CIFRAS
   ============================================
   Compartidas por cuentas, inversiones y trading. Vivían en inversiones.css,
   pero las usan las tres: como cada página carga solo su hoja, entrar
   directo a cuentas o trading las dejaba sin fondo ni borde. Aquí viven para
   que las tres las tengan siempre. */

.portfolio-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    flex-shrink: 0;
}

.resumen-card {
    background: var(--surface);
    padding: 16px;
    border-radius: 40px;
    border: 1px solid var(--border);
    text-align: center;
}

.resumen-label {
    font-size: 12px;
    color: var(--textSecondary);
}

.resumen-valor {
    font-family: var(--font-secondary);
    font-size: 24px;
    font-weight: 600;
    color: var(--text);
}

/* El skeleton del resumen es un <span> (inline), así que su `width` no se
   aplica y se queda pegado a la izquierda mientras el valor real sí sale
   centrado por .resumen-card: al cargar, la cifra salta de un lado a otro.
   Se hace block + márgenes automáticos para centrarlo.

   La regla va sobre .resumen-valor y no sobre ids concretos porque hay dos
   variantes de skeleton (skeleton-value y skeleton-value-large) y
   seleccionar solo la pequeña dejaba sin centrar las cifras grandes. */
.resumen-valor > .skeleton {
    display: block;
    margin-inline: auto;
}

.resumen-valor.positive {
    color: var(--positive);
}

.resumen-valor.negative {
    color: var(--negative);
}

/* ============================================
   BARRA DE APORTE
   ============================================
   La usan el modal de aportar a meta (dashboard y cuentas) y la sección de
   uso de crédito de una tarjeta. Estaba en dashboard.css, así que desde
   cualquier otra página salía sin pista ni relleno. */

.aporte-progreso-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aporte-progreso-wrap .badge {
    flex-shrink: 0;
}

.aporte-progreso {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: 8px;
    border-radius: 50px;
    background: var(--lightBorder);
    overflow: hidden;
}

.aporte-progreso-barra {
    width: var(--progreso, 0%);
    height: 100%;
    border-radius: 50px;
    background: var(--positive);
    transition: width 0.3s ease;
}

/* Buscador global estilo spotlight */
.buscador-global { display: flex; flex-direction: column; gap: 12px; }
.buscador-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); }
.buscador-header-icono { display: flex; color: var(--textSecondary); }
.buscador-input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); font-size: 15px; font-family: var(--font-primary); }
.buscador-input::placeholder { color: var(--textSecondary); }
.buscador-resultados { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.buscador-resultado { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--lightBorder); border-radius: 16px; background: var(--surface); cursor: pointer; transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease; }
.buscador-resultado:hover, .buscador-resultado.seleccionado { background: var(--lightHover); border-color: var(--border); transform: translateY(-1px); }
.buscador-icono { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 12px; background: var(--background); color: var(--text); flex-shrink: 0; }
.buscador-concepto { font-weight: 600; color: var(--text); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.buscador-detalle { margin-left: auto; font-size: 12px; color: var(--textSecondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40%; }
